如何找到Android中特定进程使用的内存? [英] How to find the Memory used by particular process in android?

查看:119
本文介绍了如何找到Android中特定进程使用的内存?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在努力寻找一种解决方案来查找android中特定进程使用的内存.

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

使用actvityManager.getRunningAppProcesses()我可以获取所有进程的内存使用情况的合并列表.

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

但是我需要实现一个方案,我应该通过processID并获取特定进程的内存使用情况?在Android中可以实现这种情况吗?

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?

预先感谢!

推荐答案

您可以使用

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

并用于特定过程

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

返回内存信息数组

我要请你参考这三个

在Android中获取内存使用情况

如何获取android中的当前内存使用情况?

如何发现应用程序的内存使用情况在Android中?

这篇关于如何找到Android中特定进程使用的内存?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆