LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 08-13-2006, 04:25 AM   #1
Yalla-One
Member
 
Registered: Oct 2004
Location: Norway
Distribution: Slackware, CentOS
Posts: 641

Rep: Reputation: 36
Swap no longer used


Since doing a clean re-install of slackware-current, I noticed that swap is no longer used, even though I can do swapon/swapoff /dev/hda2 without getting error messages..

What got me concerned is that when I create and install heavy apps like openoffice.org, the system memory goes very low, without any swap being used still.

Code:
Mem:    483456k total,   477112k used,     6344k free,    20424k buffers
Swap:  1951888k total,        0k used,  1951888k free,   296308k cached
When I do a swapon /dev/hda2 and swapoff /dev/hdaw, dmesg gives:
Code:
Adding 1951888k swap on /dev/hda2.  Priority:-2 extents:1 across:1951888k
System has 512MB RAM and 2GB swap partition /dev/hda2, set up in fstab by slackware install program.
(Reason why I have 2GB swap is that I just ordered another 512MB RAM to total 1GB, and I figured swap should be 2x physical memory)

Is there any way to force the use of swap to check if it's working?

-Y1
 
Old 08-13-2006, 04:45 AM   #2
introuble
Member
 
Registered: Apr 2004
Distribution: Debian -unstable
Posts: 700

Rep: Reputation: 31
I have no idea how to fix your problem but I SERIOUSLY doubt you need 2 GB swap with 1GB mem. I have 512 MB ram and chose 512MB swap
 
Old 08-13-2006, 05:19 AM   #3
Yalla-One
Member
 
Registered: Oct 2004
Location: Norway
Distribution: Slackware, CentOS
Posts: 641

Original Poster
Rep: Reputation: 36
The general recommendation for swap is 1 - 2 times physical memory, and as I have yet to figure out how to actually fill any more than 20GB of my 60GB disk, it doesn't matter the slightest if I "waste" an additional 512MB... Figured it (probably?) couldn't hurt to have some extra...

-Y1
 
Old 08-13-2006, 05:38 AM   #4
bernied
Member
 
Registered: Mar 2006
Location: Edinburgh, UK
Distribution: debian
Posts: 304

Rep: Reputation: 30
Try these for info on what your system is doing with memory and swap files:
cat /proc/meminfo
cat /proc/swaps
You could do this in a terminal while running open office to see what the added load does.
My Ubuntu install never uses more than about 2/3 of my 1GB memory, so doesn't touch the swap space.
 
Old 08-13-2006, 05:42 AM   #5
Yalla-One
Member
 
Registered: Oct 2004
Location: Norway
Distribution: Slackware, CentOS
Posts: 641

Original Poster
Rep: Reputation: 36
Thanks,

Seems like I somehow manage within the 512MB boundries of the system, as no swap is used, even though top reports free memory as low as 2048k ...

-Y1
 
Old 08-13-2006, 06:15 AM   #6
pwc101
Senior Member
 
Registered: Oct 2005
Location: UK
Distribution: Slackware
Posts: 1,847

Rep: Reputation: 128Reputation: 128
I'm not sure about this, but doesn't linux memory management only free up memory when it needs it? So for example, if you check your memory with free, then load open office and check how much it's eaten with free again and find that there's almost none left, if you then close open office and run free once more, it'll still say there's very little free memory. I thought memory management was designed in such a manner that if you then immediately reopened open office, it wouldn't have to load all that stuff back into the memory, it could just use what was already there; if however, a different memory hungy app was lauched, then it would overwrite the cached open office memory...

At least that's what I thought... here at uni, we've got some pretty beefy machines with 2GB memory, and I once ran a process which used most of that, and whenever I checked the memory usage after that, it always showed it nearly full (until the machine was rebooted).

Please correct me if I'm wrong

EDIT: general tidying up

Last edited by pwc101; 08-13-2006 at 06:17 AM.
 
Old 08-13-2006, 06:23 AM   #7
Yalla-One
Member
 
Registered: Oct 2004
Location: Norway
Distribution: Slackware, CentOS
Posts: 641

Original Poster
Rep: Reputation: 36
I believe you're right. Linux does indeed keep its stuff hanging around in memory for as long as possible, but marks it "discardable" in case another jumbo application comes around and needs it. Very wise move, and seems efficient. However, I am very far from an expert.

When has me curious is that prior to my diskcrash and subsequent re-install of Slackware, I frequently used a relatively large portion of the swap. Now however, the most I've managed to get it to use is 512KB (yeah - half a meg), which has me puzzled, as the computer is exactly the same as before, except for a new harddrive...

-Y1
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Need Help Increasing Swap by creating a swap file froggo Red Hat 3 06-13-2006 08:04 AM
Linux swap / solaris not appearing as swap in Ubuntu? Erik_the_Red Linux - Newbie 1 07-30-2005 12:57 PM
How to unmount actual swap and mount a new(bigger) swap space? isaac Linux - Newbie 1 06-06-2004 01:23 AM
Difference between Swap Virtrual memory and Swap Parition Nappa Slackware 4 11-27-2003 07:58 PM
I can no longer see anything...! Thymox Linux - Networking 8 11-19-2002 04:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 10:55 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration