Control in-memory cache of Chrome under Linux

22
2013-08
  • altendky

    I have a piddly 2GB of RAM in my 8 or so year old laptop and Chrome really likes to use all of it. Is there some way to control how much memory either all of Chrome or specifically its memory cache uses?

    To be doubly clear, I am not asking about any disk caches.

    If the answer is that I should have 'just Googled it', then please tell me what you searched for so that I can improve my Google-fu.

  • Answers
  • Marcin

    I don't think there is a way to set a hard limit on RAM usage. If you think about it, what would Chrome do when you hit the limit? Close pages? Not allow you to do anything else?

    Instead of a hard limit there are ways to manage the RAM usage manually. You can use the Task Manager (Shift+Esc) to find pages that are sucking up RAM the most and close them. There is also a hidden Purge function that you can turn on by adding

    --purge-memory-button
    

    as an argument to the Chrome shortcut. After you launch with this command line argument you will have a Purge Memory button in the Task Manager that should free up RAM if you're running low.

    You can read more about this here.


  • Related Question

    Which is better? High cache memory or low cache?
  • soul

    Which is better? High cache memory or low cache? And what exactly is their difference.


  • Related Answers
  • William Hilsum

    Always - More the better.

    If you are talking about the CPU cache, Wikipedia says it best -

    A CPU cache is a cache used by the central processing unit of a computer to reduce the average time to access memory. The cache is a smaller, faster memory which stores copies of the data from the most frequently used main memory locations. As long as most memory accesses are cached memory locations, the average latency of memory accesses will be closer to the cache latency than to the latency of main memory.