TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

How do I find the memory usage of an application on Android?

2 点作者 badhairday超过 12 年前

1 comment

Zigurd超过 12 年前
This is a relatively old question on Stackoverflow, and Dianne Hackborn's answer is authoritative as usual.<p>To sum it up: Don't worry about global free memory. Your app can use up only a relatively small part. More accurately, each component (Activity, Service, etc.) of your app with the &#60;process&#62; attribute can only use up to 48MB. Usually, all your components are in one process.<p>Within your process, Android will "destroy" (null all references) to components in your process and recreate them to optimize memory use. At times, Android will destroy every component in a process and delete ane re-create whole processes from the saved state of each component. This explains why PIDs are not reliable for tracking android app resource use. Your tasks (the components on the back stack starting with the task root, which is the component that was launched by the Launcher) are not tied to one process, nor one PID, throughout their lifespan.