Loading core/java/android/os/Debug.java +2 −1 Original line number Diff line number Diff line Loading @@ -1902,7 +1902,8 @@ public final class Debug * Retrieves the PSS memory used by the process as given by the smaps. Optionally supply a long * array of up to 3 entries to also receive (up to 3 values in order): the Uss and SwapPss and * Rss (only filled in as of {@link android.os.Build.VERSION_CODES#P}) of the process, and * another array to also retrieve the separate memtrack size. * another array to also retrieve the separate memtrack sizes (up to 4 values in order): the * total memtrack reported size, memtrack graphics, memtrack gl and memtrack other. * * @return The PSS memory usage, or 0 if failed to retrieve (i.e., given pid has gone). * @hide Loading core/jni/android_os_Debug.cpp +9 −0 Original line number Diff line number Diff line Loading @@ -540,6 +540,15 @@ static jlong android_os_Debug_getPssPid(JNIEnv *env, jobject clazz, jint pid, jlong* outMemtrackArray = env->GetLongArrayElements(outMemtrack, 0); if (outMemtrackArray != NULL) { outMemtrackArray[0] = memtrack; if (env->GetArrayLength(outMemtrack) >= 2) { outMemtrackArray[1] = graphics_mem.graphics; } if (env->GetArrayLength(outMemtrack) >= 3) { outMemtrackArray[2] = graphics_mem.gl; } if (env->GetArrayLength(outMemtrack) >= 4) { outMemtrackArray[3] = graphics_mem.other; } } env->ReleaseLongArrayElements(outMemtrack, outMemtrackArray, 0); } Loading Loading
core/java/android/os/Debug.java +2 −1 Original line number Diff line number Diff line Loading @@ -1902,7 +1902,8 @@ public final class Debug * Retrieves the PSS memory used by the process as given by the smaps. Optionally supply a long * array of up to 3 entries to also receive (up to 3 values in order): the Uss and SwapPss and * Rss (only filled in as of {@link android.os.Build.VERSION_CODES#P}) of the process, and * another array to also retrieve the separate memtrack size. * another array to also retrieve the separate memtrack sizes (up to 4 values in order): the * total memtrack reported size, memtrack graphics, memtrack gl and memtrack other. * * @return The PSS memory usage, or 0 if failed to retrieve (i.e., given pid has gone). * @hide Loading
core/jni/android_os_Debug.cpp +9 −0 Original line number Diff line number Diff line Loading @@ -540,6 +540,15 @@ static jlong android_os_Debug_getPssPid(JNIEnv *env, jobject clazz, jint pid, jlong* outMemtrackArray = env->GetLongArrayElements(outMemtrack, 0); if (outMemtrackArray != NULL) { outMemtrackArray[0] = memtrack; if (env->GetArrayLength(outMemtrack) >= 2) { outMemtrackArray[1] = graphics_mem.graphics; } if (env->GetArrayLength(outMemtrack) >= 3) { outMemtrackArray[2] = graphics_mem.gl; } if (env->GetArrayLength(outMemtrack) >= 4) { outMemtrackArray[3] = graphics_mem.other; } } env->ReleaseLongArrayElements(outMemtrack, outMemtrackArray, 0); } Loading