title: On dalvik initial heapsize
body: <p>I am currently developing an android application and I am using my own device (nexus 4) to debug it. I seem to have troubles regarding the heap size allocated by the Dalvik VM and I hope you can help me on this one.</p>
  
  <p>My application is processing a relatively important amount of data (~3MB) from a file and use it to generate java objects which go around 10MB in total. This should not be a problem for a device which has 2GB of RAM and a heap size limit of 512MB ( if I am not mistaken).</p>
  
  <p>However, the debugging tool tells me that the heap size allocated to my application is roughly 10MB, leading to an outrageous amount of garbage collection (each GC frees ~500KB). I went through already a lot of pages on SO and other forums about Dalvik heap size model, etc and I found the <code>largeHeap="true"</code> (API level 13+) attribute to use in this case, however, it did not improve anything and I am still stuck with 10MB to use when the device has an initial memory of 2GB. I understand that the OS, etc ,etc take some memory itself, that Dalvik is restricting applications as well, but why can't I reach at least the 512MB?</p>
  
  <p>So, did I misunderstood something? Did I miss something? The problem seems rather simple, but I don't get it.</p>
  
  <p>Your help will be greatly appreciated!</p>
  
  <p>PS: Please don't suggest to switch to the NDK, it is not suitable in my case.</p>