title: How do I detect the heap size usage of an android application
body: <p>I would like to know the amount of heap space used by my android application in two ways:  - programmatically
   - through DDMS.</p>
  
  <p>I have referred to <a href="https://stackoverflow.com/questions/2630158/detect-application-heap-size-in-android">this</a> post, prior to posting here. In that post, it is mentioned that, <code>Debug.getNativeHeapSize()</code> returns the heapsize. Is this the exact method I should use, in order to programmatically detect the heap size? If so, where should I log it in order to get the correct heapsize usage of my application?</p>