Page 4 of 6 FirstFirst ... 23456 LastLast
Results 31 to 40 of 53

Thread: HOWTO: Clear filesystem memory cache

  1. #31
    Join Date
    Mar 2011
    Beans
    3

    Re: HOWTO: Clear filesystem memory cache

    Oh, and this works on 10.10 Maverick. Went from 77% cache to %5 cache.

  2. #32
    psusi is offline Ubuntu addict and loving it
    Join Date
    Sep 2005
    Location
    Orlando, FL
    Beans
    3,980
    Distro
    Ubuntu Development Release

    Re: HOWTO: Clear filesystem memory cache

    Quote Originally Posted by psusi View Post
    Hibernation dumps all ram to swap so that it can be preserved without power. When you resume, most of it is only brought back to ram on demand, so things are slow while they keep having to wait to be swapped back in. I've not tried it myself, but I think I read that TuxOnIce fixes this by reading everything back in right away when you resume.
    I have been using the swsusp package lately, which fixes this. It writes everything out to disk ( and compresses it so it goes faster ), and reads it all ( or at least most, if you aren't using more than 50% of your ram ) back in when you resume. You even get a little progress indicator during the process.

  3. #33
    Join Date
    Aug 2010
    Location
    Philippines
    Beans
    143
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: HOWTO: Clear filesystem memory cache

    No mater what I do (other than reboot) my memory starts out at about 30% and gradually creeps up to about 80%+ after a few hours.

    I would really think if a reboot does it then a cache somewhere should be clearable (is that a word :-) ) to get it to drop to that magical 30% number.

    I'm on Ubuntu 10.04 Lucid and I've tried all of the following:


    # sync
    # echo 3 > /proc/sys/vm/drop_caches
    • This seems to be the most basic one that was written a few years ago in 2007. I got these answers from http://ubuntuforums.org/showthread.php?t=589975 and it seems that the following solutions were fixes that worked on later releases of Ubuntu.

    - - - - - - - - - - - - - - - - - - - - - - - -
    sudo -s
    echo 3 > /proc/sys/vm/drop_caches
    - - - - - - - - - - - - - - - - - - - - - - - -
    sync; echo 3 > /proc/sys/vm/drop_caches
    - - - - - - - - - - - - - - - - - - - - - - - -
    sudo sync; echo 3 | sudo tee /proc/sys/vm/drop_caches
    - - - - - - - - - - - - - - - - - - - - - - - -
    sudo sh -c "sync; echo 3 > /proc/sys/vm/drop_caches"
    - - - - - - - - - - - - - - - - - - - - - - - -

    Thanks in advance for any help :-)
    ~ It has recently been discovered that research causes cancer in rats. ~

    BTW; I'm using Linux Mint (based on Precise) with MATE so modify Q/A accordingly if applicable.

  4. #34
    psusi is offline Ubuntu addict and loving it
    Join Date
    Sep 2005
    Location
    Orlando, FL
    Beans
    3,980
    Distro
    Ubuntu Development Release

    Re: HOWTO: Clear filesystem memory cache

    Quote Originally Posted by tg3793 View Post
    No mater what I do (other than reboot) my memory starts out at about 30% and gradually creeps up to about 80%+ after a few hours.
    Where are you getting that figure? Look at the output of the free command in a terminal. Pay attention to the line with +/- cache, not the totals.

  5. #35
    Join Date
    Aug 2010
    Location
    Philippines
    Beans
    143
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: HOWTO: Clear filesystem memory cache

    Quote Originally Posted by psusi View Post
    Where are you getting that figure? Look at the output of the free command in a terminal. Pay attention to the line with +/- cache, not the totals.
    Sorry for the late reply. Busy last couple of days.

    But yup that's the one. Been using "free -m" and looking that line two columns to the right of the "buffers/cache" spot. ... Maybe I'll just grab a couple more gigs of RAM in a few days; but it still hits me that I should be able to clear anything from the CLI that is clear-able after a reboot.
    ~ It has recently been discovered that research causes cancer in rats. ~

    BTW; I'm using Linux Mint (based on Precise) with MATE so modify Q/A accordingly if applicable.

  6. #36
    Join Date
    Nov 2009
    Location
    Los Angeles
    Beans
    393
    Distro
    Ubuntu

    Re: HOWTO: Clear filesystem memory cache

    Quote Originally Posted by psusi View Post
    Once again for those who didn't read the whole thread: clearing the cache is not a good thing. Caching files in memory that otherwise would be empty helps system performance. As soon as it is needed, it will be reallocated, but until then it may as well be put to good use.

    To put it another way, cache memory is, for all intents and purposes, free memory, with a bonus side effect.
    Agreed, but in my case I've been doing performance testing on various file I/O routines, and without clearing cache it was impossible to get good measurements other than by rebooting.

    This thread has been a godsend for me - thanks to the OP!

  7. #37
    Join Date
    Nov 2009
    Location
    Greece
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: HOWTO: Clear filesystem memory cache

    @tg3793
    I think this is not normal, to uses 80% RAM after some hours!
    Maybe you must see why happen this.
    A simple test, is to boot with livecd Ubuntu Lucid 10.04 LTS,
    and see if this happen from there!
    If yes, then test with newer version Ubuntu Natty 11.04 and see the differences.
    Desktop : Ubuntu 10.04 LTS Lucid Lynx i386
    AMD ATHLON II X2 215 │ 3072Mb │ GeForce 210 512MB | LG W2243S : 1920 x 1080
    Laptop : Sony Vaio VGN-N11m : Ubuntu 11.10 Oneiric Ocelot i386

  8. #38
    Join Date
    Aug 2010
    Location
    Philippines
    Beans
    143
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: HOWTO: Clear filesystem memory cache

    Quote Originally Posted by psusi View Post
    Once again for those who didn't read the whole thread: clearing the cache is not a good thing. Caching files in memory that otherwise would be empty helps system performance. As soon as it is needed, it will be reallocated, but until then it may as well be put to good use.

    To put it another way, cache memory is, for all intents and purposes, free memory, with a bonus side effect.
    Yup read it. To which I have to respond ... when it works it works, and when it doesn't work; well, it doesn't work.

    There is the theoretical and then there is the actual. I say this as a guy that used to push device drivers and memory resident programs into upper memory before memmaker did it for you in DOS ... Not that it takes that kind of experience to know when it works and when it doesn't; but it helps :-)
    ~ It has recently been discovered that research causes cancer in rats. ~

    BTW; I'm using Linux Mint (based on Precise) with MATE so modify Q/A accordingly if applicable.

  9. #39
    psusi is offline Ubuntu addict and loving it
    Join Date
    Sep 2005
    Location
    Orlando, FL
    Beans
    3,980
    Distro
    Ubuntu Development Release

    Re: HOWTO: Clear filesystem memory cache

    Quote Originally Posted by tg3793 View Post
    Yup read it. To which I have to respond ... when it works it works, and when it doesn't work; well, it doesn't work.
    As it is, this statement is a tautology and handwaving. Can you be more specific? What doesn't work? After clearing the cache you are not better off, but worse off than before, because applications do not have access to any more memory than they did before, but file IO will be slowed due to the cache being cold.

    Quote Originally Posted by tg3793 View Post
    There is the theoretical and then there is the actual. I say this as a guy that used to push device drivers and memory resident programs into upper memory before memmaker did it for you in DOS ... Not that it takes that kind of experience to know when it works and when it doesn't; but it helps
    So did I. Good old dos debug

  10. #40
    Join Date
    Aug 2010
    Location
    Philippines
    Beans
    143
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: HOWTO: Clear filesystem memory cache

    Quote Originally Posted by psusi View Post
    As it is, this statement is a tautology and handwaving. Can you be more specific? What doesn't work? After clearing the cache you are not better off, but worse off than before, because applications do not have access to any more memory than they did before, but file IO will be slowed due to the cache being cold.
    To be more specific, programs stop responding, and the GUI freezes up from time to time. I know that the problem is tied to firefox; perhaps a plugin. However if I disable all of the plugins and restart firefox, I don't get 'all' of my memory back.

    In other words, if I start off at 30% of Ram and it creeps up to 80% after a few hours, if I disable all plugins (other than google talk) and restart firefox I might now be at 55%.

    I finally made it down to PCExpress and just bought a couple more Gigs of DDR2 800 RAM. We'll see what happens in a few hours. I started out at 20% about two hours ago and now I'm at 28%. Now 'that's' nothing to be concerned about.

    I'll keep watching it though. Maybe 10.04 just doesn't like hanging out with less than 4Gigs of RAM :-)
    ~ It has recently been discovered that research causes cancer in rats. ~

    BTW; I'm using Linux Mint (based on Precise) with MATE so modify Q/A accordingly if applicable.

Page 4 of 6 FirstFirst ... 23456 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •