Jason Stelzer on 16 Nov 2009 10:48:46 -0800


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] To Drop or Not Drop Caches


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

Writing to this will cause the kernel to drop clean caches, dentries
and inodes from memory, causing that memory to become free.

To free pagecache:

    * echo 1 > /proc/sys/vm/drop_caches

To free dentries and inodes:

    * echo 2 > /proc/sys/vm/drop_caches

To free pagecache, dentries and inodes:

    * echo 3 > /proc/sys/vm/drop_caches

As this is a non-destructive operation, and dirty objects are not
freeable, the user should run "sync" first in order to make sure all
cached objects are freed.

This tunable was added in 2.6.16.


Personally I never use it, but hey, if it helps you out that's cool.
There's some docs somewhere in the kernel source tree but I can't be
bothered to look. I'm sure you can grep it out.



On Mon, Nov 16, 2009 at 1:06 PM, Brian Vagnoni <bvagnoni@v-system.net> wrote:
> So I had a problem that returned to me. My system caches were eating up all my free ram, and slowing down my system. I found this and it works:
>
> http://linux-mm.org/Drop_Caches
>
> I understand that free ram is waisted, or under-utilized ram. But does it have to be all or nothing? So to cache, or not to cache, is the question. I would prefer some middle ground, like a trip wire value that would be some percentage of available ram, rather the just leave like 80mb of free ram, on my now, slowed system.
>
>
> --------------------------------------------------
> Brian Vagnoni
> PGP Digital Fingerprint
> F076 6EEE 06E5 BEEF EBBD  BD36 F29E 850D FC32 3955
> --------------------------------------------------
> ___________________________________________________________________________
> Philadelphia Linux Users Group         --        http://www.phillylinux.org
> Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
> General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug
>



-- 
J.
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug