Clearing up some memory

Anyone know of a good way to clear up excess used memory memory w/o logging out/rebooting.

Not needed. You’re under a misapprehension about used memory. Search forum for threads like “why does Linux use all RAM”.

On 12/09/2010 07:36 PM, v8skittles wrote:
>
> Anyone know of a good way to clear up excess used memory memory w/o
> logging out/rebooting.

Could you please explain this? It makes no sense to me.

The following command gets rid of cached memory:

sync; echo 3 > /proc/sys/vm/drop_caches

See also here: Linux: How To Clear The Cache From Memory
or here: drop_caches | LinuxInsight

You can turn this into a shell script and then simply run it as root.

However, keep in mind that this might not really be needed, if you consider that on Linux free memory does not equal amount of memory up for grabs.

On 12/09/2010 09:36 PM, Lord Emsworth wrote:
>
> v8skittles;2264149 Wrote:
>> Anyone know of a good way to clear up excess used memory memory w/o
>> logging out/rebooting.
>
> The following command gets rid of cached memory:
>
> Code:
> --------------------
> sync; echo 3 > /proc/sys/vm/drop_caches
> --------------------
>
>
> See also here: ‘Linux: How To Clear The Cache From Memory’
> (http://tinyurl.com/clvxgj)
> or here: ‘drop_caches | LinuxInsight’
> (http://www.linuxinsight.com/proc_sys_vm_drop_caches.html)
>
> You can turn this into a shell script and then simply run it as root.
>
>
> However, keep in mind that this might not really be needed, if you
> consider that on Linux free memory -does not- equal amount of memory up
> for grabs.

In fact, clearing cache will hurt the performance of Linux.

You mean, because some of what was previously cached in RAM, now has to be re-read from HD?

On 2010-12-10 06:06, Lord Emsworth wrote:
>
> lwfinger;2264191 Wrote:
>> In fact, clearing cache will hurt the performance of Linux.
>
> You mean, because some of what was previously cached in RAM, now has to
> be re-read from HD?

Yes.


Cheers / Saludos,

Carlos E. R.
(from 11.2 x86_64 “Emerald” at Telcontar)