I have successfully found the available free RAM but i want to find Ram usage in MB
for All running Applications.
I have tried this link but I am not able come up with Solution.
What kind of functionality would this require?
I have successfully found the available free RAM but i want to find Ram usage in MB
for All running Applications.
I have tried this link but I am not able come up with Solution.
What kind of functionality would this require?
You can try to use dumpsys meminfo
to get memory usage.
Process proc = Runtime.getRuntime().exec("");
BufferedReader reader = new BufferedReader(new InputStreamReader(proc.getInputStream()));
DataOutputStream out = new DataOutputStream(proc.getOutputStream());
// periodically execute dumpsys meminfo
out.writeBytes("dumpsys meminfo\n");
out.flush();
// read mem log and do some parsing job
while (reader.ready()) {
line = reader.readLine();
// you can parse the log
}