Jump to content

My Swap Tip


SoulSe
 Share

Recommended Posts

Cannonfodder, I agree with aRTee that there's not much to say other than get more ram. It's so cheap now, heck it's cheap oem crap but I got 2 128MB DDR400 PC2100 sticks for $40.00USD, but I realize it may not be so cheap around the world. I've still got a free slot I need to fill though :twisted: :P .

 

To chalk one up for kernel-2.4.21.mdk, though it's the same kernel that was causing http://www.mandrakeusers.org/viewtopic.php?t=3994 , in an attempt to flush/or get a fresh swap I tried the swapoff command with only 7MB physical mem free, and though it would usually take about 2 minutes the kernel would recover. So I thought "Hmmmm, ram is cheap, I'm ticked off, lets just see", so I commented out the swap line in fstab and rebooted :twisted: ......It ran :shock: Sure, when it ran out of mem it was super slow, but it ran, trying to keep 4 to 7 MB free...try that in windows :lol: Yes, I only did it for about 5 min, and stopped.

Link to comment
Share on other sites

just a comparison.

 

justin@morpheus justin $ free -b

            total       used       free     shared    buffers     cached

Mem:     791928832  765767680   26161152          0  150958080  453865472

-/+ buffers/cache:  160944128  630984704

Swap:   2048086016    2670592 2045415424

 

 

justin@morpheus justin $ free -m

            total       used       free     shared    buffers     cached

Mem:           755        730         24          0        141        435

-/+ buffers/cache:        153        602

Swap:         1953          2       1950

j

 

[edited by bvc for 'code'....now isn't that better? :wink: ]

Link to comment
Share on other sites

Where there's a linux....there's a way....usually a few or more :wink:

localhost:~# free -m

            total       used       free     shared    buffers     cached

Mem:           250        241          9          0         52        107

-/+ buffers/cache:         82        168

Swap:          298          0        298

localhost:~#

localhost:~# cat /proc/meminfo

       total:    used:    free:  shared: buffers:  cached:

Mem:  263114752 253128704  9986048        0 54865920 112259072

Swap: 312516608        0 312516608

MemTotal:       256948 kB

MemFree:          9752 kB

MemShared:           0 kB

Buffers:         53580 kB

Cached:         109628 kB

SwapCached:          0 kB

Active:          88020 kB

Inactive:       123060 kB

HighTotal:           0 kB

HighFree:            0 kB

LowTotal:       256948 kB

LowFree:          9752 kB

SwapTotal:      305192 kB

SwapFree:       305192 kB

localhost:~#

localhost:~# cat /proc/stat    

cpu  16090 0 3621 171931

cpu0 16090 0 3621 171931

page 380555 53344

swap 1 0

localhost:~# cat /proc/swaps

Filename                        Type            Size    Used    Priority

/dev/hda5                       partition       305192  0       -1

localhost:~#

Link to comment
Share on other sites

I have 768MB of ram and use a 2048MB swap partion, why you ask?  Don't know, I just do it.  Currently with Gentoo my swap rarely get's touched, wasted space, 80GB, I don't care.

 

THe other end of a 2x ram, who know's?  I just installed Solaris on 4 V880 with a swap space of 16GB, depends on what you are going to do I guess??

 

Whoa! 2gb, that's a third of my hdd! Though, nowadays that's no space at all.

Link to comment
Share on other sites

I have 768MB of ram and use a 2048MB swap partion, why you ask?  Don't know, I just do it.  Currently with Gentoo my swap rarely get's touched, wasted space, 80GB, I don't care.

 

THe other end of a 2x ram, who know's?  I just installed Solaris on 4 V880 with a swap space of 16GB, depends on what you are going to do I guess??

 

Whoa! 2gb, that's a third of my hdd! Though, nowadays that's no space at all.

 

Yeah, I don't know why anymore I know I don't ever use that much. Just a normal practice I got used to I guess.

Link to comment
Share on other sites

  • 2 weeks later...

If I use "free" after a typical for me session on the net, it reports say 16 mb used, out of a total swap space of 203 mb. My ram is 64 mb.

Does this mean that during the session I used a maximum of 16 mb of swap? Even using Gimp, I don't use more than a max of about 25 mb as reported by "free".

Originally the swap size was set for twice ram = 128 mb plus a cushion selected arbitrarily. As space is getting tight, I would like to reclaim some of the space set aside for swap for use in /home and maybe /usr. I could reclaim some 60 mb from swap, maybe.

It's a one way change, however, as once I take space from swap and assign it to other partitions, there is no going back to increase swap space later if I change my mind.

Thanks for your help.

Link to comment
Share on other sites

I could see lowering it to 100 but with your amount of ram, I wouldn't go any lower...just in case. I have a machine with 192MB ram and it has never gone over 50MB swap (not counting the weird gnome/X/nvidia issue that ate up everything) and even that is extremely rare.

Link to comment
Share on other sites

Hello bvc:

Thanks for your reply and information re swap. As I have 203 mb swap with 64 mb ram, I will look into reducing swap space to about 140 mb (2x64=128 mb + cushion). This will gain me about 63 mb for /home, which now is quite needed.

Link to comment
Share on other sites

  • 1 month later...

I try to keep my linux swap partition at 2 to 3 times physical RAM size. Currently I have 1 GB physical and 2 or 3 GB swap (can't remember at the moment, and am in windows).

 

My attitude is I can never have enough memory or hdd space. :D

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...