Curious thing with memory and swap [Solved]

If you want to talk about your personal paperweight, you've found the right place!

Moderator: Moderators

Curious thing with memory and swap [Solved]

Postby leobing » Fri May 22, 2009 19:37

I have been worrying about a small thing for a while and while poking around with this and trying different things, I discovered something.
My computer is an HP triple core AMD with 3 gigs ram and 2 320 gig hds.
During installation I made a 3 gig swap partition as that is what is recommended by many Linux gurus.
What was bothering me is that while the computer was running and only having 4 or 5 things running like:
Firefox, thunderbird, su /terminal and file manager. "top" would show that I was actually using all the ram and some of the swap. Things would slow down a touch. This would take a while to show up but it always did.
I have now done "swapoff /dev/sda5" and have no swap .
For some reason I now have "top" showing:
954,408k and almost 2 gigs free. There is no slowing down and it is running just fine.
From this I gather that something is much different in this kernel and making a large swap partition is not the way to go.
Maybe someone can explain why this works this way as I am curious enough to want to know.
Thanks much for any responses.
LINUX, no virus, no worms, no spy ware, no charge, so why Windows?
< running Linux > VE7UW/VE7OKV
Baby Hen
Posts: 14
Joined: Thu Nov 15, 2007 6:22
Location: Kelowna, B.C. Canada

Re: Curious thing with memory and swap

Postby kodiakmax » Sun May 24, 2009 7:01

linux uses memory different than windows. Most people are not aware of that. read this. ... f9f5e4dfcf
As for why you were perceiving slow downs, that does not make much sense to me.
If you check the wiki, use the search function and google you can find the answer to most of your questions.

Remember to mark your thread [Solved] if your issue is fixed.
Advanced Hen
Posts: 278
Joined: Thu Oct 16, 2008 23:46

Re: Curious thing with memory and swap

Postby WarraWarra » Sun May 24, 2009 17:05

IMHO worst case scenario = that is normal loads with swap on or off.
Normal user will not see this but heavy users will.

OSX / Apple with 1gb ddr2 800mhz ram + 2.4ghz core extreme will have on avg a 5gb -> 7gb -> 14gb swap if you check the resources and then firefox + = :cry: :eye: just add microsoft anything or entourage = it is dead. Just ahd to fix one Apple in the middle of the night :evil:

You are not doing to bad.

Some other websites also does this but not as bad as the avg 720mb ram used for ? and having several websites / pages open especially photo's and a mix of this = 1.4gb ram used easily.

All the spam harassment / torture adds on the sides of the most web-pages helps to add to this and with some flash type adds you can even lockup firefox and crash it in any OS but this is old and normal.

Firefox is just plain and simple not capable of running normal user / teenager loads with internet pages / links open in any OS and the current yahoo+google against firefox wars is not helping it.

Terminal if you are running a few installs / compiles then you would start to use swap space as some packages compiling / installing can load a lot during this process. 400mb to 800mb for 1 package I installed yesterday and nothing else running. "emerge"

The combination of buggy memory usage thunderbird and firefox with a few windows open = ram usage hell then add terminal and your results seems normal.

The memory management if there is no swap just forces everything to go starving, run more efficiently and better use their resources if swap is off but will on occasion get full ram use if you go full throttle.

PS> if no swap then linux will use a virtual / temporary swap like feature to cope somewhere in the tmp folders but only as last resort. Swap was there for the small hard drive days to try and limit waisted space to a partition instead of a big blob in tmp folder that keeps on growing for no reasosn.

To test this use vmware with 1gb ram and 2gb swap and see how many times you can crash most linux distro's with installing packages and not using firefox root terminal only no desktop env.
I hit 3 times a hour in the last 2 days I tried using gentoo.
"linux = gentoo based in my concept" i486/x86 as base copes better / more bugs ironed out as compared to i686 on most kernels.

Hope this helps shed some light on things.
Sagely Hen
Posts: 1989
Joined: Wed Jan 03, 2007 21:01
Location: 31.324270, -113.585511

Re: Curious thing with memory and swap

Postby leobing » Wed Jun 03, 2009 5:50

Thanks very much. I now have a much better idea about swap and ram.
LINUX, no virus, no worms, no spy ware, no charge, so why Windows?
< running Linux > VE7UW/VE7OKV
Baby Hen
Posts: 14
Joined: Thu Nov 15, 2007 6:22
Location: Kelowna, B.C. Canada

Return to Off Topic

Who is online

Users browsing this forum: No registered users and 2 guests