Slackware This Forum is for the discussion of Slackware Linux.
|
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
|
03-31-2005, 09:09 AM
|
#1
|
|
Member
Registered: Dec 2004
Location: Ball of Confusion
Distribution: Slackware,Bluewhite64
Posts: 252
Rep:
|
reducing RAM usage
I am using KDE atm ... 512MB RAM, 2GB swap
I want to know how to free up RAM and cache .... when I do a cold boot there is about 75-80MB of RAM ... after an hour of surfing the web I close my browser(firefox) and there is 200MBs ... I realize this is because it keeps stuff cached for easy access ... and perfectly normal
but my problem I run into is I do Folding@Home with this PC and leave it on 24/7 and after about 2 weeks my swap file can grow to 1.5GBs  ... and this has a big effect on performance since it has to search through that to get at files and images, etc
So how do I remove temp internet files, cache, etc etc from the RAM?
Last edited by Furlinastis; 03-31-2005 at 09:11 AM.
|
|
|
|
03-31-2005, 09:15 AM
|
#2
|
|
Guru
Registered: Apr 2003
Location: ~
Distribution: Ubuntu, FreeBSD, Solaris, DSL
Posts: 5,339
Rep:
|
That sounds more like a mem leak then temp or cache files. What program is the one taking so much RAM?. Run "top" to find it out...
|
|
|
|
03-31-2005, 09:17 AM
|
#3
|
|
Senior Member
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,591
|
There are many tuning knobs for virtual memory control, but probably the most effective for your issue is the swappiness:
cat /proc/sys/vm/swappiness
60
By reducing this number, you reduce the system's tendency to swap (putting more pressure on the cache). Less information will be kept in cache (meaning increased I/O), but for your particular situation it might be effective.
I suggest adding the following to /etc/rc.d/rc.local before a reboot:
echo "20" > /proc/sys/vm/swappiness
If the system remains more responsive over a longer interval, then it is working for you.
|
|
|
|
03-31-2005, 09:42 AM
|
#4
|
|
Member
Registered: Dec 2004
Location: Ball of Confusion
Distribution: Slackware,Bluewhite64
Posts: 252
Original Poster
Rep:
|
Quote:
Originally posted by Megaman X
What program is the one taking so much RAM?. Run "top" to find it out...
|
I actually did a complete reinstall yesterday ... so I was more of asking how to prevent it from happening as I just figured it would do it again ... and I only run F@H, firefox, AMSN IMer, then maybe your oddball program like the Gimp or whatever
irt mace ... thnx I'll do that soon as I get back I have to step out a bit
but isn't there a temp directory like windows(i know that's a bad word around here  ) has? in which I could clear every week or so, as I fail to see the point of keeping all that internet and system clutter around
|
|
|
|
03-31-2005, 09:44 AM
|
#5
|
|
Senior Member
Registered: Nov 2003
Location: West Sussex, England
Distribution: Gentoo
Posts: 1,457
Rep:
|
Maybe use WM that's smaller than KDE. . ?
|
|
|
|
03-31-2005, 09:58 AM
|
#6
|
|
Member
Registered: Mar 2005
Distribution: slackware-current
Posts: 379
Rep:
|
Yeah there is a /tmp directory but it is not mapped into /dev/shm by default so it shouldn't be taking up ram. The correct way to delete it is to switch into single user mode "init 1" and then it is safe to just rm everything there and then init 3 back into multi user mode.
You could also rm it in your shutdown script which is what I do, but since you never reboot just "init 1" and rm it.
Also linux doesn't give back memory that applications use right away it will hold on to it for a while just in case you start up again. To get a true measure of how much ram you are using do a "free -m"... take the used and subtract the cache.
Funny I only have 256 MB of ram and box almost never uses more than a MB or so of swap. And after 10 minutes or so when I'm doing do whatever mem intensive things it will drop back down to zero. You may have a mem link. what is f@h?
|
|
|
|
03-31-2005, 10:02 AM
|
#7
|
|
Senior Member
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,591
|
Quote:
Originally posted by Furlinastis
but isn't there a temp directory like windows(i know that's a bad word around here ) has? in which I could clear every week or so, as I fail to see the point of keeping all that internet and system clutter around
|
The system will automatically age old files in the /tmp directory, there's no need to clean it out manually (and you can't just delete the contents; programs will fail).
In any case, the contents of the /tmp directory and things like browser cache are disk files. They are not the cache that is being referred to in memory ( RAM).
|
|
|
|
03-31-2005, 10:08 AM
|
#8
|
|
Member
Registered: Mar 2005
Distribution: slackware-current
Posts: 379
Rep:
|
Quote:
Originally posted by macemoneta
The system will automatically age old files in the /tmp directory, there's no need to clean it out manually (and you can't just delete the contents; programs will fail).
In any case, the contents of the /tmp directory and things like browser cache are disk files. They are not the cache that is being referred to in memory (RAM).
|
In slack they will stay forever unless you add it to your shutdown script or "init 1" rm it. Also programs wont fail if you "init 1" and rm it and then go back "init 3".
|
|
|
|
03-31-2005, 10:08 AM
|
#9
|
|
Member
Registered: Feb 2005
Location: Denver, CO
Distribution: Slack 12, tweaked just so (though I'm also a fan of Ubuntu)
Posts: 198
Rep:
|
I think I'd have to echo Mace on this one.
First, the memory that's being used, that's honestly just cached things that aren't yet freed up. They don't get written to disk, and get reused at need, so no sweat there.
Second, firefox does keep a cache that's much like the old "Temporary Internet Files" model - in ~/.mozilla/firefox directory, I think.
|
|
|
|
03-31-2005, 10:10 AM
|
#10
|
|
Senior Member
Registered: Jun 2004
Location: Argentina (SR, LP)
Distribution: Slackware
Posts: 3,145
Rep:
|
Furlinastis I would try stop using your programs one at the time to see which one has a memory leak. I've two computers 24/7 both running F@H and never had a problem with them.
The swap is not used by temporary files but for programs to get more memory, so try not using ie: amsn for two weeks and see what you have. If you still have a swamp overload try not running another program, etc.
chbin, F@H or Folding@Home a project similar to SETI@Home but for looking different things about proteins and related stuff. The homepage is: http://folding.stanford.edu/
Last edited by gbonvehi; 03-31-2005 at 10:13 AM.
|
|
|
|
03-31-2005, 10:42 AM
|
#11
|
|
Member
Registered: Apr 2004
Location: Europe
Distribution: Debian, Slackware
Posts: 497
Rep:
|
Cleaning up /tmp (and /var/tmp) is safe as long as you don't delete recent tempfiles. I've had a script like this:
Code:
#!/bin/bash
find /tmp -type f -atime +3 -exec rm {} \;
find /var/tmp -type f -atime +27 -exec rm {} \;
in my cron.daily for as long as I can remeber and have never had any problems with it. It considers files in /tmp outdated if they are last accessed more than 3 days ago. For /var/tmp, files accessed more than 27 days ago are considered outdated.
Last edited by alienDog; 03-31-2005 at 10:45 AM.
|
|
|
|
03-31-2005, 04:28 PM
|
#12
|
|
Senior Member
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,591
|
Quote:
Originally posted by chbin
In slack they will stay forever unless you add it to your shutdown script or "init 1" rm it. Also programs wont fail if you "init 1" and rm it and then go back "init 3".
|
I'm surprised; most distributions I've looked at are using tmpwatch to age the /tmp directory. I wasn't aware that Slack doesn't provide this. Thanks for the info!
|
|
|
|
03-31-2005, 04:37 PM
|
#13
|
|
Member
Registered: Mar 2005
Distribution: slackware-current
Posts: 379
Rep:
|
Pat ships it pretty much unmodified. He only adds things that are absolutely essential to get it to boot. The odds and ends are up to you and you alone. Who knows maybe someone wants to keep it around... and doesn't want it deleted. Perhaps they use temp to compile and build source. Who knows.
|
|
|
|
03-31-2005, 05:06 PM
|
#14
|
|
Senior Member
Registered: May 2004
Distribution: Slackware 13.0 32-bit
Posts: 1,973
Rep: 
|
I think one thing that might worth knowing, is what exactly are you running? Are you running current, 10.1 , or 10.0? Since, also there is a different KDE version in each
|
|
|
|
04-01-2005, 04:31 PM
|
#15
|
|
Member
Registered: Dec 2004
Location: Ball of Confusion
Distribution: Slackware,Bluewhite64
Posts: 252
Original Poster
Rep:
|
Quote:
Originally posted by macemoneta
There are many tuning knobs for virtual memory control, but probably the most effective for your issue is the swappiness:
cat /proc/sys/vm/swappiness
60
|
I can't seem to find that file  ... I have the following in /proc/sys/vm:
bdflush
block_dump
kswapd
laptop_mode
max-readahead
max_map_count
min-readahead
overcommit_memory
page-cluster
pagetable_cache
vm_cache_scan_ratio
vm_gfp_debug
vm_mapped_ratio
vm_passes
vm_vfs_scan_ratio
Quote:
Originally posted by alienDog
Cleaning up /tmp (and /var/tmp) is safe as long as you don't delete recent tempfiles. I've had a script like this:
Code:
#!/bin/bash
find /tmp -type f -atime +3 -exec rm {} \;
find /var/tmp -type f -atime +27 -exec rm {} \;
in my cron.daily
|
there are two files in that folder:
logrotate
slocate
which file should I add that script to? or should I just create a new file? if so what should I name it?
TIA
(BTA I'm using 10.0)
Last edited by Furlinastis; 04-01-2005 at 04:32 PM.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 04:22 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|