When starting a (1st) .NET application the CLR seems to allocate a
very large (100s of MB, continuous AFAIK) virtual memory, as evident
by the process VM size of even a toy app. The CLR also seems to
reserve about 32MB of memory, as seen by the "# Total Reserved Bytes"
performance counter. I take this to mean that 32MB of the allocated VM
are "locked down" in RAM, even if the managed memory needed initially
by the application (reflected in the "# Total Committed Bytes"
performance counter) is much smaller. Can this be changed?
The reason I ask is I noticed that if I reduce the physical memory on
my XP (using /burnmemory boot.ini switch) our application starts and
quickly hangs the machine (must press the start button to shutdown,
then restart). At this stage the application only takes about 16MB of
phsical memory (the "Private Bytes" performance counter, and similar
working set), out of which only 2.5MB is managed (I assume much of the
unmanaged memory is due to EXE + DLLs, including the CLR). I suspect
the hang may be due to the additional 32MB (well, minus 2.5MB counted
above) reserved by the CLR (I should note my 256MB XP hangs only if
you start the application soon after reboot; aparently XP hasn't
collected enough memory yet, as seen in the Available Memory in the
Task Manager performance tab).
Is there some way to reduce this value and make the CLR start with
less? Anyone knows if this value is dependent on RAM, #CPUs, OS
version,...? (I read there are different GC engines for workstation
and server, mscorwks.dll and mscorsvr.dll). Does the .NET framework
have any related configuration settings or runtime parameters?
Thanks,
-- Shaul Dar (Please cc sh****@medcon.com)