title: On Android, why does the ps command show high virtual memory when an app hasn't allocated anything?
body: <p>I'm using the ps command on Android to determine the memory being used by an application (just a normal Java-based app).  I have a test app that allocates as much memory as possible (by repeatedly creating 1 megabyte byte arrays an adding them to a List so they don't go out of reference, until an allocation fails).</p>
  
  <p>The "RSS" (Resident Set Size) column shown by ps for the test app seems sensible - when the app starts up it is low, then after I have allocated a bunch of memory it is much higher.  But the VSIZE/VSS column is very high to begin with and doesn't change.  What is the meaning of the VSIZE/VSS column as reported by ps on Android?</p>
  
  <p>Here is the output of ps for my test app before I explicitly allocate any memory.  The units are kilobytes</p>
  
  <pre><code>USER     PID   PPID  VSIZE  RSS     WCHAN    PC         NAME
  u0_a55    2271  91    468664 30008 ffffffff 00000000 S com.dave.quicktest
  </code></pre>
  
  <p>And here it is after I allocate memory until exhaustion:</p>
  
  <pre><code>USER     PID   PPID  VSIZE  RSS     WCHAN    PC         NAME
  u0_a55    2271  91    468692 287232 ffffffff 00000000 S com.dave.quicktest
  </code></pre>
  
  <p>RSS when up from 30mb to 287mb, a difference which roughly matches the amount of memory allocated.  But VSIZE was 468mb to begin with, and doesn't change much.  Why?</p>
  
  <p>Also, can I confirm that the Android OS does not in practice use a pagefile/swap space?  I don't doubt it is possible to build/configure it to do so, but in normal, stock OS builds, does it ever do VM paging to storage?</p>
  
  <p>Thanks guys!</p>