title: Measuring an Android process memory usage
body: <p>What is the correct way to measure an android process memory usage?
  The Allocated memory after GC? Or should I look at something else?</p>
  
  <p><strong>Edit 2:</strong> With correct way = should I measure using heap dump or should I use USS+PSS values? Why measure using USS when allocated memory in my opinion is a better way?</p>
  
  <p><strong>Edit:</strong>
  TY, and yes I've already looked at this answer. Though I really can't find an answer for my question in that post. Quote: "So how much memory a processes uses is really not clear". (Because the shared ram is hard to calculate?) What is the most accepted solution?</p>
  
  <p>I'm looking at this post: <a href="https://android-developers.blogspot.com/2011/03/memory-analysis-for-android.html" rel="nofollow noreferrer">memory-analysis-for-android</a>. If you show heap updates on your application then cause a GC you get some memory info: <a href="https://i.stack.imgur.com/1jdqq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1jdqq.png" alt="3.bp.blogspot.com/-VojtZFBXA3E/TYryrWDJLQI/AAAAAAAAAS4/hl5aecZuMXg/s1600/ddms-heap-usage.png"></a></p>
  
  <p>There you have The Allocated memory after GC, what's wrong looking at that number?</p>
  
  <p>Ive also looked at: <a href="https://kohlerm.blogspot.com/2009/02/how-to-really-measure-memory-usage-of.html" rel="nofollow noreferrer">how-to-really-measure-memory-usage-of</a> and dumped the hprof and loaded it in Eclipse memory Analyzer. Looking at the "The retained size" for my application, wouldn't that be a number to look at?
  Dosen't that mean if I kill my process, this much memory would be freed? Isn't that the definition of USS? </p>
  
  <p>Thanks, and sorry if my first question wasn't clear.</p>