0

I am struggling for a solution to find the memory used by particular process in android.

Using actvityManager.getRunningAppProcesses() I can able to get the consolidated list of all process's memory usage.

But i need to implement a scenario where I should pass the processID and get the memory usage of particular process? Is this scenario possible in Android?

Thanks in Advance!

0

2 Answers 2

3

You can get the memory info using

MemoryInfo mi = new MemoryInfo();
ActivityManager activityManager = (ActivityManager) getSystemService(ACTIVITY_SERVICE);
activityManager.getMemoryInfo(mi);

and for a particular process use

activityManager.getProcessMemoryInfo(new int[]{process_ids}); 

which returns an array of memory information

I would ask you to refere these three

Get Memory Usage in Android

How to get current memory usage in android?

How do I discover memory usage of my application in Android?

Sign up to request clarification or add additional context in comments.

Comments

0

See these links:

https://stackoverflow.com/a/2299813/1369222

http://macgyverdev.blogspot.in/2011/11/android-track-down-memory-leaks.html

Note that this isn't an exact science and instead of looking for a general "memory usage of a process" you should be looking for something more specific to your requirements. Anyway, those links will help you get started.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.