Manualy Free Ram up

  • Thread starter Thread starter Mark Harris
  • Start date Start date
M

Mark Harris

Is there some way i can programaticaly clear the ram the application is
running, or force the garbage collection to occur?

Also, an application starts off using 8mb or so of ram - when i run RAM
Booster this drops to about 1.6mb - thats a pretty huge waste of ram.

When a client connects to the application (its a tcp server of such) ram
goes up to 13mb, but when the client leaves it stays up there, the next
client then seems to take over that ram space which is incredibly annoying.

- Mark Harris
 
Mark said:
Is there some way i can programaticaly clear the ram the application
is running, or force the garbage collection to occur?

GC.Collect();
GC.WaitForPendingFinalizers();
GC.COllect();

(But I never suggest to do this!)
Also, an application starts off using 8mb or so of ram - when i run
RAM Booster this drops to about 1.6mb - thats a pretty huge waste of
ram.

What you see is the decrease of the working-set; not the memory!

By the way: 8 MB is by design! It is reserved upon CLR startup!
When a client connects to the application (its a tcp server of such)
ram goes up to 13mb, but when the client leaves it stays up there,
the next client then seems to take over that ram space which is
incredibly annoying.

This is also ba design. If there is enough ram, memory is not freed.

--
Greetings
Jochen

Do you need a memory-leak finder ?
http://www.codeproject.com/tools/leakfinder.asp

Do you need daily reports from your server?
http://sourceforge.net/projects/srvreport/
 
Thanks for the reply and info,

You see this program is for game hosts, if they see it using 8mb of ram
they will not be too please heh.
 
Back
Top