LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices



Reply
 
Search this Thread
Old 03-31-2005, 10:09 AM   #1
Furlinastis
Member
 
Registered: Dec 2004
Location: Ball of Confusion
Distribution: Slackware,Bluewhite64
Posts: 252

Rep: Reputation: 30
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 10:11 AM.
 
Old 03-31-2005, 10:15 AM   #2
Mega Man X
Guru
 
Registered: Apr 2003
Location: ~
Distribution: Ubuntu, FreeBSD, Solaris, DSL
Posts: 5,339

Rep: Reputation: 63
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...
 
Old 03-31-2005, 10:17 AM   #3
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 328Reputation: 328Reputation: 328Reputation: 328
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.
 
Old 03-31-2005, 10:42 AM   #4
Furlinastis
Member
 
Registered: Dec 2004
Location: Ball of Confusion
Distribution: Slackware,Bluewhite64
Posts: 252

Original Poster
Rep: Reputation: 30
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
 
Old 03-31-2005, 10:44 AM   #5
oneandoneis2
Senior Member
 
Registered: Nov 2003
Location: London, England
Distribution: Ubuntu
Posts: 1,460

Rep: Reputation: 46
Maybe use WM that's smaller than KDE. . ?
 
Old 03-31-2005, 10:58 AM   #6
chbin
Member
 
Registered: Mar 2005
Distribution: slackware-current
Posts: 379

Rep: Reputation: 31
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?
 
Old 03-31-2005, 11:02 AM   #7
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 328Reputation: 328Reputation: 328Reputation: 328
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).
 
Old 03-31-2005, 11:08 AM   #8
chbin
Member
 
Registered: Mar 2005
Distribution: slackware-current
Posts: 379

Rep: Reputation: 31
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".
 
Old 03-31-2005, 11:08 AM   #9
cavalier
Member
 
Registered: Feb 2005
Location: Denver, CO
Distribution: Slack 12, tweaked just so (though I'm also a fan of Ubuntu)
Posts: 198
Blog Entries: 1

Rep: Reputation: 30
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.
 
Old 03-31-2005, 11:10 AM   #10
gbonvehi
Senior Member
 
Registered: Jun 2004
Location: Argentina (SR, LP)
Distribution: Slackware
Posts: 3,145

Rep: Reputation: 51
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 11:13 AM.
 
Old 03-31-2005, 11:42 AM   #11
alienDog
Member
 
Registered: Apr 2004
Location: Europe
Distribution: Debian, Slackware
Posts: 505

Rep: Reputation: 46
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 11:45 AM.
 
Old 03-31-2005, 05:28 PM   #12
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 328Reputation: 328Reputation: 328Reputation: 328
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!
 
Old 03-31-2005, 05:37 PM   #13
chbin
Member
 
Registered: Mar 2005
Distribution: slackware-current
Posts: 379

Rep: Reputation: 31
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.
 
Old 03-31-2005, 06:06 PM   #14
Jeebizz
Senior Member
 
Registered: May 2004
Distribution: Slackware 14.1 64-bit with multilib
Posts: 2,092

Rep: Reputation: 222Reputation: 222Reputation: 222
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
 
Old 04-01-2005, 05:31 PM   #15
Furlinastis
Member
 
Registered: Dec 2004
Location: Ball of Confusion
Distribution: Slackware,Bluewhite64
Posts: 252

Original Poster
Rep: Reputation: 30
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 05:32 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
RAM/SWAP usage ganja_guru Linux - Software 13 12-29-2004 04:17 AM
Problem with RAM usage! shazam75 Linux - Software 5 11-14-2004 07:58 PM
Huge RAM usage? RTT Slackware 4 11-28-2003 04:51 PM
RAM usage Serena Linux - General 1 08-12-2003 11:50 PM
Average RAM usage... KevStA Linux - Newbie 7 05-31-2002 05:58 PM


All times are GMT -5. The time now is 12:14 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration