ActivityManager.GetProcessMemoryInfo(Int32[]) Method

Definition

Return information about the memory usage of one or more processes.

[Android.Runtime.Register("getProcessMemoryInfo", "([I)[Landroid/os/Debug$MemoryInfo;", "GetGetProcessMemoryInfo_arrayIHandler")]
public virtual Android.OS.Debug.MemoryInfo[]? GetProcessMemoryInfo(int[]? pids);
[<Android.Runtime.Register("getProcessMemoryInfo", "([I)[Landroid/os/Debug$MemoryInfo;", "GetGetProcessMemoryInfo_arrayIHandler")>]
abstract member GetProcessMemoryInfo : int[] -> Android.OS.Debug.MemoryInfo[]
override this.GetProcessMemoryInfo : int[] -> Android.OS.Debug.MemoryInfo[]

Parameters

pids
Int32[]

int: The pids of the processes whose memory usage is to be retrieved.

Returns

Attributes

Remarks

Return information about the memory usage of one or more processes. Note: this method is only intended for debugging or building a user-facing process management UI.

As of Android Q, for regular apps this method will only return information about the memory info for the processes running as the caller's uid; no other process memory info is available and will be zero. Also of Android Q the sample rate allowed by this API is significantly limited, if called faster the limit you will receive the same data as the previous call.

Android reference for android.app.ActivityManager.getProcessMemoryInfo.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to