title: Why is Available Physical Memory (dwAvailPhys) > Available Virtual Memory (dwAvailVirtual) in call GlobalMemoryStatus on Windows Vista x64
body: <p>I am playing with an MSDN sample to do memory stress testing (see: <a href="http://msdn.microsoft.com/en-us/magazine/cc163613.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/magazine/cc163613.aspx</a>) and an extension of that tool that specifically eats physical memory (see <a href="http://www.donationcoder.com/Forums/bb/index.php?topic=14895.0;prev_next=next" rel="nofollow noreferrer">http://www.donationcoder.com/Forums/bb/index.php?topic=14895.0;prev_next=next</a>).  I am obviously confused though on the differences between Virtual and Physical Memory.  I thought each process has 2 GB of virtual memory (although I also read 1.5 GB because of "overhead".  My understanding was that some/all/none of this virtual memory could be physical memory, and the amount of physical memory used by a process could change over time (memory could be swapped out to disc, etc.)I further thought that, in general, when you allocate memory, the operating system could use physical memory or virtual memory.  From this, I conclude that dwAvailVirtual should always be equal to or greater than dwAvailPhys in the call GlobalMemoryStatus.  However, I often (always?) see the opposite.  What am I missing.</p>
  
  <p>I apologize in advance if my question is not well formed.  I'm still trying to get my head around the whole memory management system in Windows.  Tutorials/Explanations/Book recs are most welcome!</p>
  
  <p>Andrew</p>