This forum has been archived. All content is frozen. Please use KDE Discuss instead.

to swap or not to swap?

Tags: None
(comma "," separated)
User avatar
sebas
KDE Developer
Posts
88
Karma
2
OS

to swap or not to swap?

Sun Oct 12, 2008 11:49 pm
I've recently played around with disabling swap on my machine. When resuming the machine from suspend, I often get swap storms bogging down the machine for a while. I'm suspecting the fglrx driver here doing nasty things to my virtual memory. It happens more often when more of the memory is in use. So I thought my remedy would be just not using swap, this laptop has 2.5Gb of RAM in it, that should be enough for the necessary bits.

What I don't like about this is the theory that swapping is not supposed to make the machine slower. In theory, reading things from swap is pretty much always faster than reading it from disk since you're able to read larger blocks of memory with less seeking of the harddisk.

So what are other's experiences with swap and not running with swap?


-- sebas
Elv13
Registered Member
Posts
23
Karma
0
OS

RE: to swap or not to swap?

Mon Oct 13, 2008 12:18 am
According to RedHat (I have followed RedHat Certified Engeneer class), it is always faster with swap. not because you need it, but because of the memory management algorytm used if swap is present. Too much swap reduce performances, but having swap do make your computer faster.


Elv13, proud KDE user since KDE 2.2.
andreasramm
Registered Member
Posts
1
Karma
0

RE: to swap or not to swap?

Mon Oct 13, 2008 1:09 am
Generally you don't want to disable swap. If an application does request a lot of memory all disabling will do is kill that application or something else on your system.

Your best bet is to find the offending process and make it behave.

Having said that there is a parameter called swappiness 'cat /proc/sys/vm/swappiness' that you can play with to fine tune your system. Check out http://gentoo-wiki.com/FAQ_Linux_Memory_Management or a tutorial of your choice for full details ;)
pansz
Registered Member
Posts
113
Karma
0
OS

RE: to swap or not to swap?

Mon Oct 13, 2008 2:29 am
IMO swap is not meant to make the computer faster or slower, it is here to make good use of your physical memory.

Most applications will have fatal problems when memory reaches the limit. i.e. if you have 2G memory, then when 1.99G memory is used , most applications may not function properly.

What will happen if you had a 256MB swap? yes, you can make good use of your 2G memory since everything will work properly when you really used up the 2G memory.

My suggestion is to make the swap size between 128MB and 2GB regardless of your physical memory size. If you don't need a big swap then simply make it 128MB.
zgornel
Registered Member
Posts
1
Karma
0

RE: to swap or not to swap?

Tue Oct 14, 2008 12:18 am
I agree with pansz. Usually keeping a small swap (file even) is much more efficient than disabling it.
User avatar
sebas
KDE Developer
Posts
88
Karma
2
OS

RE: to swap or not to swap?

Mon Oct 27, 2008 1:31 am
I'm now running the Free ati driver instead of the nasty fglrx blob and the swap storms have stopped, the machine is immediately responsive post-resume. The swappiness knob is also quite useful, I had already played around with it, but it didn't prevent the minute-long swap storms that often happened when I had lots of memory in use and suspend the machine.

Thanks for the interesting input everybody.


-- sebas
User avatar
of_darkness
Registered Member
Posts
73
Karma
0

RE: to swap or not to swap?

Mon Oct 27, 2008 1:38 am
well im glad that i dont kneed swap any more but i still feal that my 8gb of ram is 2 little.. im often on the brink of filling it upp...:P

so 12-16 ore so would be perfect i think and a top of the schelf quadcore processor:P

and im ofc. running a desktop computer:)
but if i ewer is gonny buy a laptop it realy neads 8gb of ram:P[hr]
andreasramm wrote:Generally you don't want to disable swap. If an application does request a lot of memory all disabling will do is kill that application or something else on your system.

Your best bet is to find the offending process and make it behave.

Having said that there is a parameter called swappiness 'cat /proc/sys/vm/swappiness' that you can play with to fine tune your system. Check out http://gentoo-wiki.com/FAQ_Linux_Memory_Management or a tutorial of your choice for full details ;)

but if you have ram that meats the all of the nead for memory then there cant be any nead for swap? or?

like i have 8gb of ram and it dos not use 100% but tops around 90-95% at times..

Last edited by of_darkness on Mon Oct 27, 2008 1:41 am, edited 1 time in total.


of_darkness, proud to be a member of KDE forums since 2008-Oct.
User avatar
Alec
Registered Member
Posts
565
Karma
1
OS

RE: to swap or not to swap?

Mon Oct 27, 2008 5:23 am
of_darkness,

It's actually perfectly normal that you have all your ram filled up - Linux tries to use up as much ram as possible since empty ram = waste of ram. I actually don't think you really need so much ram for a desktop.

Try looking up the Memory section in KInfoCenter. You will have "Application Data," which is what your applications actually take up, and Cache/Buffers, which is basically some contents of your hard drive that are left in memory so that they could be quickly retrieved if they are needed again.

I personally think my 2 GB is way too much. :-P
I even mounted my /tmp into ram to make some more use of it. :shade:


Get problems solved faster - get reply notifications through Jabber!
User avatar
of_darkness
Registered Member
Posts
73
Karma
0

RE: to swap or not to swap?

Mon Oct 27, 2008 9:53 am
Alec wrote:of_darkness,

It's actually perfectly normal that you have all your ram filled up - Linux tries to use up as much ram as possible since empty ram = waste of ram. I actually don't think you really need so much ram for a desktop.

Try looking up the Memory section in KInfoCenter. You will have "Application Data," which is what your applications actually take up, and Cache/Buffers, which is basically some contents of your hard drive that are left in memory so that they could be quickly retrieved if they are needed again.

I personally think my 2 GB is way too much. :-P
I even mounted my /tmp into ram to make some more use of it. :shade:


OO ofc. i know that and im also looking at what is in the ram, and 60% right now is apliction data or the bottom blue segment inte the systemmonitor:)

but then i hawe alot of tabs in opera (100~) and unlimied history in several konsole tabs and i have alot of them to:P

and alot of other stuff open..

thtas why i want 2 have as mouch ram as possible and i have sean the diffrence in spead and less lagg.

so if could get say 100gb ram possibility i would go and bouy as mouch ram as i could..


of_darkness, proud to be a member of KDE forums since 2008-Oct.
john_hudson
Registered Member
Posts
549
Karma
2
OS

RE: to swap or not to swap?

Mon Oct 27, 2008 9:08 pm
At the moment, most programs are not written to make use of large amounts of RAM; so however much RAM you had, unless you had lots of programs running simultaneously, they wouldn't use it anyway.


John Hudson, proud to be a member of KDE forums since 2008-Oct.
User avatar
of_darkness
Registered Member
Posts
73
Karma
0

RE: to swap or not to swap?

Mon Oct 27, 2008 9:45 pm
john_hudson wrote:At the moment, most programs are not written to make use of large amounts of RAM; so however much RAM you had, unless you had lots of programs running simultaneously, they wouldn't use it anyway.



webbrowsers opera/ff lowes 2 eat ram.

and yeas i do have alot of apps running at the same time, if i had a more ram and an quad i would run kde4 session and gnom at the same time as kde3..

and then i would be able 2 have some image eddting going 2 but now, now it would realy seap upp ram when having gimp running 24/7 a couple of days as thats how i do stuff..


of_darkness, proud to be a member of KDE forums since 2008-Oct.
User avatar
Alec
Registered Member
Posts
565
Karma
1
OS

RE: to swap or not to swap?

Mon Oct 27, 2008 10:39 pm
of_darkness wrote:OO ofc. i know that and im also looking at what is in the ram, and 60% right now is apliction data or the bottom blue segment inte the systemmonitor:)

but then i hawe alot of tabs in opera (100~) and unlimied history in several konsole tabs and i have alot of them to:P


Wow. In that case you really do need it. ;)
I probably have about as many bookmarks as you have tabs.


Get problems solved faster - get reply notifications through Jabber!
User avatar
of_darkness
Registered Member
Posts
73
Karma
0

RE: to swap or not to swap?

Mon Oct 27, 2008 11:02 pm
Alec wrote:
of_darkness wrote:OO ofc. i know that and im also looking at what is in the ram, and 60% right now is apliction data or the bottom blue segment inte the systemmonitor:)

but then i hawe alot of tabs in opera (100~) and unlimied history in several konsole tabs and i have alot of them to:P


Wow. In that case you really do need it. ;)
I probably have about as many bookmarks as you have tabs.


yupps:P i have always been good at using upp ram:P too mouch to be able 2 use compiz ore having the gnomesettings deamon running to get my synaptick looking good:P(thers is a workaround but i havent had the botter to do it)

ohh bookmarks i have tons of 2:P and crashed sessions whit alot of pages that should be bookmarked:P and pages wisited history that 99999999(as many of them that i can fit in the setting):P


of_darkness, proud to be a member of KDE forums since 2008-Oct.


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Google [Bot], Sogou [Bot], Yahoo [Bot]