Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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
share|improve this question
    
What do you mean by "RAM Cache" and how do you tell that it's getting full? –  Sergey Nov 17 '11 at 10:30
    
Can you please run free -g (in terminal) when you experience the problem and include the output of the command in your question. –  Portablejim Nov 17 '11 at 10:35
    
On my upper panel I have an applet that indicates RAM and CPU usage grafically. When I click it, it tells me that: "Mem: 2GB Cache 4GB" –  Tobias Nov 17 '11 at 17:13
1  
free -g says you've 3GB of free RAM. Memory is not your problem! –  ams Nov 17 '11 at 19:59
    
Ok great thanks for clearing that up, but perhaps because in that moment I was not streaming online? I just had chromium running. –  Tobias Nov 17 '11 at 21:44
show 1 more comment

4 Answers

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. :)

share|improve this answer
    
I am using just 1,8% of SWAP. Cooling is not the problem as I have a cooling pad with two fans. I know video is processor intensive but i5 quad core 2,4GH and 6GB RAM should definitively be enough for smooth streaming. –  Tobias Nov 17 '11 at 17:14
    
1.8% of swap suggests to me that your problem is not that you've run out of RAM. I agree, as long as your processor has not been throttled, it ought to be able to do the job. –  ams Nov 17 '11 at 19:57
    
Ok than perhaps it is the Browser itself? –  Tobias Nov 17 '11 at 21:44
    
Thanks for your answers I will try to use another browser and let you know if the issue persists. Thanks again, you were very helpful and kind, I really appreciate! –  Tobias Nov 17 '11 at 21:45
add comment

I've the same problem, it seems the cache is never released... One example was when I checked out a repository and end up with a cache of 4GB

Example:

$ free -m
             total       used       free     shared    buffers     cached
Mem:          7949       7425        523          0        112       4433
-/+ buffers/cache:       2879       5069
Swap:         7627          2       7625

What I did was to run the code bellow (the comments are just so you know what is going on), you may create a script so you can run it when you need it:

# 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
sudo sync && sudo sysctl -w vm.drop_caches=3

After I ran the code above:

$ free -m
             total       used       free     shared    buffers     cached
Mem:          7949       2820       5129          0          2        407
-/+ buffers/cache:       2409       5539
Swap:         7627          2       7625
share|improve this answer
3  
This is not a problem, this is how the page cache works. It will keep things cached as long as possible, but release items automatically when memory pressure from other applications increases. Clearing it up manually is unnecessary. –  Caesium Nov 22 '11 at 16:08
2  
It may be so but in that case the algorithm is not that good. Why would I've more than 4GB of cache and start to use swap? –  Carlo Nov 23 '11 at 8:29
    
On the subject, I like this article: link –  Carlo Nov 23 '11 at 8:30
    
In my current case I'm checking out a huge repository and all files are getting cached until it fills up the memory, once there it starts to swap instead of release cache... –  Carlo Nov 23 '11 at 8:33
    
I used to take an interest in kernel development .. Pretty sure this is still "by design." If the kernel thinks that part of a file is more likely to be accessed again soon than some anonymous data, it would swap the anon data and keep the page cache. Whether it's making the right decision is a different question, of course :) –  Steve Dee Feb 6 at 22:36
add comment

My suggestion would be to run any process explorer (System Monitor for example) and check what is the process consuming so much memory. post it here and we'll see if you can turn it off.

ps. ok, I get it now. I bet its 'plugin container' that grows with time due to the way it uses memory. I guess its because its a port from Gill Bates system;). Killing it wont help (by killing it you'll crash all animations on each page, mainly ads but also Youtube videos). Also, Chromium itself loves to bloat with time so the only way to deal with it would be probably to restart it from time to time. See if it helps...

share|improve this answer
    
Indeed, when I restart the browser, the streaming runs smoothly again, however just for 10minutes. Then I have to restart the browser again. –  Tobias Nov 17 '11 at 17:17
    
The Processes used: Chromium 250MB Chromium 214 MB Chromium 150Mb, compiz 119 MB, zeitgeist-daemon 111 MB, chromium 70Mb, exe 24% of CPU and 60MB, Rhythmbox 50MB, ubuntuone-syndaemon 26MB etc.. –  Tobias Nov 17 '11 at 17:22
    
Im afraid your problem may be caused by the browser itself. Consider switching to Firefox or any of your choice, users opinion over the web says Chromium consumes about 3x more memory than any other 'top line' browser. Give it a try. Install, open the same number of tabs and compare... –  Adam Kroczyk Nov 17 '11 at 23:37
    
I'll dp that. Thanks very much for the suggestion. all the best –  Tobias Nov 18 '11 at 9:27
add comment

jonathan@jonathan-Lenovo:~$ sudo su

[sudo] password for jonathan:

root@jonathan-Lenovo:/home/jonathan# echo 3 > /proc/sys/vm/drop_caches

This will instantaneously clear your ram of all cache safely.

share|improve this answer
    
In addition to being a poor answer, this was already covered by one of the other, much older answers. –  psusi Nov 7 '12 at 16:40
add comment

protected by Braiam Feb 7 at 3:40

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.