Ubuntu – Why is the cache in the memory always full

cachememoryram

I have 6GB RAM, i5 2.4GHZ Processor running Ubuntu 11.10. I partitioned my HD so that I have 8GB swap.

When streaming online or opening several tabs in Chromium I soon have 4GB Memory in the cache. And I think this makes my Notebook slow. When streaming a video, after a few minutes it really slows down and stumbles/jerks.

What could the problem be? How can I solve this?

P.S: initially I had 4GB and recently upgraded to 6GB, but I did not experience a significant change.

P.P.S: free -g in the terminal prints this:

               total       used       free     shared    buffers     cached
Mem:             5          2          3          0          0          0
-/+ buffers/cache:          1          4
Swap:            8          0          8

Best Answer

Caching data is RAM is supposed to make things faster, not slower - fetching things repeatedly from disk when you have unused memory is just silly. If you're spilling into swap space though, that will hit performance. You can easily tell if you're using any swap by running System Monitor. If the swap-space graph isn't climbing at the time the problem starts, then the problem isn't memory related.

Certainly, when you stream video it will get cached in memory, but it takes quite a lot of video to fill 6Gb! I'd expect it to take more than just a few minutes to download that much data, and much more to cause a problem!

Are you sure something else isn't the problem? Say, cooling perhaps? Many notebooks have processors that are overspeced compared to the cooling system. This is good - it gives high peak performance, good for bursty traffic, while keeping the bulk down - but it can't keep up the performance for long before it is forced to dial back the clock rate or melt. Video can be fairly processor intensive, so you never know?

Anyway, you should be able to see from the memory usage whether it's swapping or not. If it is, then that's a software problem, and those can be fixed. :)

Related Question