I have a memory issue with .NET, as you all know by now .NET takes a lot of
memory, however with the promise to give it back, if the system is running
on low resources. I have a target machine with very specific hardware of
512M running XP with no virtual memory. When I ran my GUI application which
is very rich in GDI we hit 150M of private bytes. Task manager shows the
working size, however it is irrelevant, what matters is the private bytes.
Therefore running API such as SetProcessWorkingSize are not only a bad idea,
it is useless.
In search of the memory, I used ANTS profiler to find out where the memory
goes. I found that 20M of RAM is used by the managed heap - that leaves me
with 130M of unmanaged memory.
Is it possible to know where that memory is used, it is not possible that
..NET takes so much.
Is there a way to force .NET to give some memory back? GC.Collect is only
good for freeing memory on the managed heap, which does not mean the memory
is returned to the OS.