Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Clearing Cached Memory
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
dritan
Apprentice
Apprentice


Joined: 01 Feb 2006
Posts: 210
Location: New York

PostPosted: Tue May 01, 2007 2:10 pm    Post subject: Clearing Cached Memory Reply with quote

hey guys,

i just got a new laptop and it works like a charm, there is only 1 small problem, after using the system for a while, especially if i emerge something, the cached memory will be full (the light green part on the memory of gnome-system-monitor) and all my apps run very slow, it disappears when i reboot but i dont want to reboot all the time, so how can i clear it, or say limit how much to use?

Thanks
_________________
Regards,
Dritan

Please try to help answer the unanswered
Back to top
View user's profile Send private message
Angry_Red_Antz
Tux's lil' helper
Tux's lil' helper


Joined: 31 Mar 2005
Posts: 103
Location: Pittsfield, Massachusetts, But 100% Boricua

PostPosted: Tue May 01, 2007 2:37 pm    Post subject: Reply with quote

you can do this:

echo 1 > /proc/sys/vm/drop_caches #To free pagecache

echo 2 > /proc/sys/vm/drop_caches #To free dentries and inodes:

echo 3 > /proc/sys/vm/drop_caches # to do both
_________________
Show me the Linux!
Back to top
View user's profile Send private message
dritan
Apprentice
Apprentice


Joined: 01 Feb 2006
Posts: 210
Location: New York

PostPosted: Tue May 01, 2007 3:05 pm    Post subject: Reply with quote

wow! worked miracle!

now i'll make it into a little script and cron it!

thanks a bunch!!
_________________
Regards,
Dritan

Please try to help answer the unanswered
Back to top
View user's profile Send private message
phajdan.jr
Retired Dev
Retired Dev


Joined: 23 Mar 2006
Posts: 1777
Location: Poland

PostPosted: Tue May 01, 2007 5:48 pm    Post subject: Reply with quote

I wouldn't say that it's a good solution, because you may now waste cache. Options mentioned above were introduced mainly to allow to perform benchmark from the same state (nothing cached).

As far as I understand your problem, emerge puts many files into cache, and your applications get swapped out. You can try the swap prefetch patch from ck-sources. It brings swapped out pages back to RAM when the system is idle. So in theory after your emerge ends, it should automatically de-swap apps and not needlessly waste cache.

If you would like however to take approach proposed in the previous post - nothing bad, okay. But don't put it in the cron script, just run it after emerge to bring system back to usable state. Running it too often will actually make your system run slower, because of wasted cache.
Back to top
View user's profile Send private message
dritan
Apprentice
Apprentice


Joined: 01 Feb 2006
Posts: 210
Location: New York

PostPosted: Wed May 02, 2007 10:46 am    Post subject: Reply with quote

i see...i guess i will give ck a try then, nothing harmful anyways...i just have one little question, how can i find out which packages are compiled against my kernel? i know my ipw3945 is, but i am sure there are more...is there any way to find out?
_________________
Regards,
Dritan

Please try to help answer the unanswered
Back to top
View user's profile Send private message
phajdan.jr
Retired Dev
Retired Dev


Joined: 23 Mar 2006
Posts: 1777
Location: Poland

PostPosted: Wed May 02, 2007 11:38 am    Post subject: Reply with quote

dritan wrote:
i see...i guess i will give ck a try then, nothing harmful anyways...i just have one little question, how can i find out which packages are compiled against my kernel? i know my ipw3945 is, but i am sure there are more...is there any way to find out?


module-rebuild (emerge module-rebuild if you don't have it). Included help should tell you how to use it.
Back to top
View user's profile Send private message
dritan
Apprentice
Apprentice


Joined: 01 Feb 2006
Posts: 210
Location: New York

PostPosted: Wed May 02, 2007 7:19 pm    Post subject: Reply with quote

thanks alot,
didnt know that there was a little handy tool like that! your help is much appreciated
_________________
Regards,
Dritan

Please try to help answer the unanswered
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum