views:

80

answers:

1

I have a C++ code compiled with Intel compiler, 32bit, in MS VC6 mode, so using either msvcrt.dll or msvcrtd.dll. The process makes heavy memory allocation and deallocation. I monitor the memory usage with WMI and look at VirtualSize and WorkingSetSize.

with debug runtime (msvcrtd.dll): virtual constant 1.7GB, working constant 1.2GB
with non-debug runtime (msvcrt.dll): virtual raising 1.7-- 2.1GB, working raising 1.2-1.4GB
with non-debug runtime but under debugger (windbg): virtual constant 1.7GB, working constant

At 2.1 GB virtual the process is crashing (as expected). But why would the virtual usage increase only with (non-debug) msvcrt.dll and only if not under debugger? In all cases compilation flags are identical, only runtime libs are different.

A: 

Often the problem is uninitialized local variables which are nulled by the debug RTL, but not when using the release RTL. Have a look at "Surviving the Release Version" and see if this helps.

sbi