LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Filling Swap without refreshing it (https://www.linuxquestions.org/questions/linux-newbie-8/filling-swap-without-refreshing-it-224735/)

aquajai 08-31-2004 06:22 AM

Filling Swap without refreshing it
 
Hello,

I am new to linux. Using RH 8. Problem is my Linux machine is having 256 MB RAM and 251 MB swap space. The problem is on running the machine RAM usage is 235/241.

and SWAP is like it goes on increasing all the time and as it reached highest limit machine goes dead slow and then Mouse movement is impossible.

My problem is - is it possible to refresh the swap time to time. It shd be get freed after use.

Please respond

aquajai

amosf 08-31-2004 06:44 AM

The swap continually increasing like that is probably a sigen of a leaky program somewhere, usually mozilla, which you may have to restart now and then... Also not really enough swap for a 256meg box. I had 500meg swap on my box til recenlty, which was okay, tho now run about a gig...

Full ram usage is normal, by the way. Linux will always use all the ram. The swap is different, but you need more to run several apps on KDE or gnome and such...

chrism01 08-31-2004 10:35 AM

The old rule (when ram was eg < 256 MB) was twice as much swap as RAM.
These days I'd go for a min of 512MB or at least as much as you've got RAM, whichever is biggest.
Personally, with such large cheap disks about these days, I tend to think in terms of setting swap to 1 or 2 GB during install, and prob never have to worry again :)

amosf 08-31-2004 10:46 AM

Yep. These days hd space is cheap so I run over a gig swap... I suppose I should bump up the ram too, but the plan is to upgrade the MB/CPU soon, so why waste the money :)

amosf 08-31-2004 10:48 AM

I should continue to say my point is you can buy a 80gig drive cheaper for an old box than 256meg ram... ANd the 80gig drive will go in the new box, unlike the ram...

aquajai 09-01-2004 02:20 AM

Thanks for replies.

I just want to know that how to increase SWAP on running system as i am having space to increase swap.

Waiting for reply again.

btmiller 09-01-2004 02:47 AM

You can make a swapfile to augment your swap partition:

dd if=/dev/zero of=/path/to/swapfile bs=512 count=<number of 512 byte blocks you want>

mkswap /path/to/swapfile

then activate it with:

swapon /path/to/swapfile

To ensure it gets turned on at each reboot, add the appropriate line to /etc/fstab (it will look like your current swap device line, but with the path to your swapfile).

Also, that behavior is definitely abnormal. Running out of memory shouldn't kill the system (when it runs very low on memory, the kernel should start killing memory hogging processes). You might run top or ps to see what's hogging your memory, and maybe memtest86 to make sure your memory is good.


All times are GMT -5. The time now is 04:23 PM.