title: c++ dynamic memory allocation limit
body: <p>Is there any kind of limit, system or otherwise, for dynamic allocation with new or malloc in C++?
  The system is 64bit and I want to allocate an array of some ~800million structs. </p>
  
  <p>Edit: The reason I didn't test it on my own before was because I don't currently have access to a machine with enough memory, so I felt that there was no point testing it on my current machine.</p>
  
  <p>After running my own tests, I can allocate 800million elements fine, but malloc returns NULL once I hit ~850million. The struct contains 7 floats, so the total size is about 22GB.
  What's the reason behind this seemingly arbitrary limit? This machine has 4GB of ram and 4GB virtual memory, so I'm not sure why I'm even able to allocate that much.</p>