Why does my Visual Studio C++ 2013 program use up so much more RAM in Debug mode than it does in Release?
<p>I'm currently running a project that organizes a number of rectangle objects into a R*Tree index, for optimized loading of geospatial mapping data.</p>

<p>The project loads a map cut up into 2 million rectangles, and organizes them in a tree-like structure, where each leaf node of the tree contains groupings of these rectangles based on their mapset coordinates. </p>

<p>In release mode of Visual Studio C++, RAM costs at about 500-700mb for the duration. </p>

<p><a href="http://i.stack.imgur.com/l8b2l.jpg" rel="nofollow">Release Shot</a></p>

<p>However, when in Debug, RAM costs are quite high closing between 1.7-2.0 Gigabytes.</p>

<p><a href="http://i.stack.imgur.com/dHN6g.jpg" rel="nofollow">Debug Shot</a></p>

<p>What I was wondering is where this drastic increase in RAM cost is coming from? I am looking for something to decrease the cost of memory in Debug so that breakpoints and error-handling can be done without an issue.
Otherwise bad-memory allocation exceptions will be a pain when dealing with Maps that contain more than 2 million rectangles.</p>