M
Mike Peretz
I have tried everything to make .NET return memory to the OS. I use Dispose
and GC.Collect() as much as possible. I understand that if the memory is
available then why not take it and keep it. However, I noticed that memory
is only returned to the OS when the machine is desperate for RAM, but at
that point it is way too late, the OS is swapping and everything becomes
very slow. The other case where memory is returned to the OS is when I
minimize the application. According to Microsoft Documentation, the process
working size is trimmed, causing memory to be cashed or to be returned to
the OS.
Don't get me wrong, I understand that .NET is like an OS and needs to manage
its own heaps and that is not cheap by any means. But! For the love of God,
my little windows application with an Access connection is just consuming
more and more memory every time I click on a new option. On average, it
starts with 20M and can grow to 40M. Nothing, except minimizing the
application seems to work. This can not be acceptable, am I the only one
that noticed this?
and GC.Collect() as much as possible. I understand that if the memory is
available then why not take it and keep it. However, I noticed that memory
is only returned to the OS when the machine is desperate for RAM, but at
that point it is way too late, the OS is swapping and everything becomes
very slow. The other case where memory is returned to the OS is when I
minimize the application. According to Microsoft Documentation, the process
working size is trimmed, causing memory to be cashed or to be returned to
the OS.
Don't get me wrong, I understand that .NET is like an OS and needs to manage
its own heaps and that is not cheap by any means. But! For the love of God,
my little windows application with an Access connection is just consuming
more and more memory every time I click on a new option. On average, it
starts with 20M and can grow to 40M. Nothing, except minimizing the
application seems to work. This can not be acceptable, am I the only one
that noticed this?