TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

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

2 pointsby badhairdayover 12 years ago

1 comment

Zigurdover 12 years ago
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.