Memory usage

P

Peter Morris

I understand how .NET will force a garbage collection before an out of
memory exception etc, but I am still concerned with how much memory my .NET
app seems to hold onto according to the task manager.

Constantly my apps (all running via terminal services on the same machine)
are reaching around 100MB per user (8 - 15 users), but this drops down to
8MB when the app is minimised so I know I am not at fault myself!

I am guessing that the GC collects .NET objects but doesn't necessarily give
the ram back to Windows. Is there anything I can do about this? I'd like
my .NET app to be more memory friendly to other apps on the machine.


Thanks

Pete
 
B

Brian Rasmussen [C# MVP]

As Peter said the CLR does release memory to the OS. However, it usually
holds on to allocated memory for a little while longer than absolutely
needed in case memory new allocations should request more memory. Allocating
memory is not a cheap operation, so this makes sense.
 
C

Chakravarthy

Did you ever got to know about CLR Profiler.. try this, you will understand
in detail as why you see the differences in the memory sizes.

HTH
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top