LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 08-16-2006, 09:52 PM   #1
timothyb89
Member
 
Registered: Jul 2006
Location: Colorado, USA
Distribution: openSuSE 11.4
Posts: 118

Rep: Reputation: 15
Move Main System from RAM to swap


I'm wondering if it possible to move my main system and a few other programs into swap. I have some 5 GBs of swap, and there are a few games I want to play some memory-heavy games, but the performance is, well, horrible, and I know it's because I am running out of RAM. I have 1 GB of RAM, but that hasn't really helped. So is there a way to clear out my RAM and move it into SWAP space?
 
Old 08-16-2006, 10:17 PM   #2
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,118

Rep: Reputation: 315Reputation: 315Reputation: 315Reputation: 315
The Linux memory manager is pretty smart, and as a general rule it's best not to try to outthink it. That being said, there are a few things you can do -- first is to play with some of the vm setting in sysctl (see sysctl -a | fgrep 'vm.' for a list). In particular you can set the "swappiness" level hoigher to encourage the memory manager to move unused stuff out to swap faster. I'm not sure what some of the others do, but the swapiness is the main tunable.

A more pragmatic solution may be to run a lighter weight window manager / desktop environment. These can eat up a lot of memory, some of which must stay swapped in because the window manager has stuff running in the background (e.g. artsd on KDE). I'm not sure how much of a difference it will make but it's worth a try. One good thing to do is run a top while the game is running and then hit M (capital-M) to sort by memory usage. The size is the total size of all the application's pages and the RSS is the resident size (how much is actually mapped into memory). Look at the big offenders. Is there anything running in the background that should not be?

If the size of the game itself is significantly over 1 GB (or even close to it), you might need to upgrade your RAM since the entire game doesn't fit into memory (after all the OS and system programs need to snatch some memory to do their jobs).
 
Old 08-16-2006, 11:40 PM   #3
timothyb89
Member
 
Registered: Jul 2006
Location: Colorado, USA
Distribution: openSuSE 11.4
Posts: 118

Original Poster
Rep: Reputation: 15
So what types of Window managers would you recommend? I have just about any one you can think of in my SUSE install.
And what would this "top" program be? I've seen it around the forums but I'm still not sure...
 
Old 08-17-2006, 03:58 PM   #4
timothyb89
Member
 
Registered: Jul 2006
Location: Colorado, USA
Distribution: openSuSE 11.4
Posts: 118

Original Poster
Rep: Reputation: 15
ok. I got into sysctl, but how can I change "vm.swappiness" from 60 to make it swap more of my stuff?
 
Old 08-17-2006, 04:11 PM   #5
timothyb89
Member
 
Registered: Jul 2006
Location: Colorado, USA
Distribution: openSuSE 11.4
Posts: 118

Original Poster
Rep: Reputation: 15
Ok- another update- I figured out how to up the swappinness.
What would you reccomend I set it to? (It's currently at 75)
 
Old 08-17-2006, 05:13 PM   #6
Matir
Moderator
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,507

Rep: Reputation: 118Reputation: 118
75 is fairly 'swappy'. You could try something like 90 even.

top is a command line program that shows what programs are using what resources.
 
Old 08-23-2006, 04:03 PM   #7
timothyb89
Member
 
Registered: Jul 2006
Location: Colorado, USA
Distribution: openSuSE 11.4
Posts: 118

Original Poster
Rep: Reputation: 15
Ok... I've set the swappiness to 90, but every time I reboot, it is set back to 60.
How can I fix this?
 
Old 08-23-2006, 04:41 PM   #8
Matir
Moderator
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,507

Rep: Reputation: 118Reputation: 118
Quote:
Originally Posted by timothyb89
Ok... I've set the swappiness to 90, but every time I reboot, it is set back to 60.
How can I fix this?
On most systems, it's controlled by /etc/sysctl.conf.
 
Old 08-25-2006, 08:04 PM   #9
timothyb89
Member
 
Registered: Jul 2006
Location: Colorado, USA
Distribution: openSuSE 11.4
Posts: 118

Original Poster
Rep: Reputation: 15
Nope, it's not sysctl.conf.
I'm using SuSE, BTW.

The sysctl.conf file exists, but if doesn't have anything but things about IP stuff...

Last edited by timothyb89; 08-25-2006 at 08:12 PM.
 
Old 08-25-2006, 10:40 PM   #10
dfego
LQ Newbie
 
Registered: Jul 2006
Location: New Rochelle, NY
Distribution: Gentoo
Posts: 18

Rep: Reputation: 0
I don't know about the swappiness, but about your other questions...

More lightweight window managers would be stuff like Fluxbox. I personally use that and find it's much lighter than GNOME, KDE, etc. Those two are full desktop environments, where Fluxbox is just a window manager. You might also be interested in Enlightenment and Blackbox.

As for "top," if you go to a command line and type "top" and press enter, you'll get a readout of all your usage stats at the moment. Check out the man page for it to find out what you can change.
 
Old 08-26-2006, 03:49 PM   #11
timothyb89
Member
 
Registered: Jul 2006
Location: Colorado, USA
Distribution: openSuSE 11.4
Posts: 118

Original Poster
Rep: Reputation: 15
Ok, I found my swappiness vm in /proc/sys/vm/ but I can't edit it. I'll tweak it the next time I boot into Windows or Knoppix.
 
  


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
What happens when your system runs of RAM and swap? LinuxGeek Linux - General 2 06-16-2006 02:56 PM
Want to resize main and swap partitions Shay Suse/Novell 1 11-19-2004 11:31 AM
Something about linux main and swap partition julian_s Linux - Newbie 2 01-18-2004 11:30 PM
main partition now swap...? arlothemoo Linux - General 1 10-23-2002 01:18 AM
Moving swap back to main memory acid_kewpie Linux - General 4 08-26-2001 09:40 AM


All times are GMT -5. The time now is 11:35 PM.

Main Menu
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