Hi All,
My CentOS 5.0 is running on x86 machine with 4GB RAM. It runs as a webserver and there is a small java applet application.
When the system is fresh reboot, there is below 1GB of used memory and as times go , the used memory increased to over 3.5GB.
Is there a way to free memory out like those program which works under Windows?
Thank you.
b4 doing that, why not investigate to see which program eat up the memory and do something about it.
On Wed, 20 Jun 2007, Fung wrote:
Hi All,
My CentOS 5.0 is running on x86 machine with 4GB RAM. It runs as a webserver and there is a small java applet application.
When the system is fresh reboot, there is below 1GB of used memory and as times go , the used memory increased to over 3.5GB.
Is there a way to free memory out like those program which works under Windows?
Thank you.
_______________________________________________ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Fung wrote:
Hi All, My CentOS 5.0 is running on x86 machine with 4GB RAM. It runs as a webserver and there is a small java applet application. When the system is fresh reboot, there is below 1GB of used memory and as times go , the used memory increased to over 3.5GB. Is there a way to free memory out like those program which works under Windows?
What do you want with free memory? Or: What do you expect to free up? "Unused" memory in Linux (memory which isn't used by applications) is largely used for caching and for storing kernel buffers. As soon as this memory is needed by an application, it is freed by the kernel.
So: Unused memory is wasted memory.
Cheers,
Ralph
Around 04:12pm on Wednesday, June 20, 2007 (UK time), Fung scrawled:
When the system is fresh reboot, there is below 1GB of used memory and as times go , the used memory increased to over 3.5GB.
Is there a way to free memory out like those program which works under Windows?
Basically you shouldn't want to, Linux is very efficient in using all the memory available. It will handle it for you, and you need not worry about running out.
There are lots of explanations of this on-line, here for instance: http://gentoo-wiki.com/FAQ_Linux_Memory_Management
Steve
Fung spake the following on 6/20/2007 8:12 AM:
Hi All,
My CentOS 5.0 is running on x86 machine with 4GB RAM. It runs as a webserver and there is a small java applet application.
When the system is fresh reboot, there is below 1GB of used memory and as times go , the used memory increased to over 3.5GB.
Is there a way to free memory out like those program which works under Windows?
Thank you.
Linux doesn't work like that. The extra used memory is just buffers and will be freed if anything needs memory.
On Wed, Jun 20, 2007 at 11:12:31PM +0800, Fung wrote:
When the system is fresh reboot, there is below 1GB of used memory and as times go , the used memory increased to over 3.5GB.
Are you sure that the memory is really used? Linux will take unused memory and use it as a disk cache so if you read the same files again and again then it will serve them from cache. This makes things a lot faster.
If you then start up a program that needs more memory Linux will shrink the cache. Because this is read-only data, the cache shrinking is very quick and causes almost zero performance penalty (the standard memory mapping algorithm can handle it). As programs free up memory then the cache will expand again.
So, on this PC:
total used free shared buffers cached Mem: 1003316 941708 61608 0 267000 516808 -/+ buffers/cache: 157900 845416 Swap: 2024148 12324 2011824
The "Mem" lines says that I'm using 940Mb out of my 1Gb. But the line afterwards says that really only 157Mb is being used; the other 780Mb is used for cache and buffers and is really "free" memory.
This "unified memory management" system is extremely powerful. You just need to be careful of what the numbers mean :-)