Click to See Complete Forum and Search --> : Cannot use a swap partition?
raid517
10-12-2004, 03:05 PM
Hi, well this is deeply confusing. I made a swap file of 1GB in Mepis Linux - but no matter what I do, it seems Mepis refuses to use it.
Previously (on a prior install) I discoverd that this was due to the Mepis automatic fstab configuration utility messing my partition table up. It had listed the swap partition as /boot the /home patition as swap, the swap partition as /home and so on. A very silly bug in other words.
Fixing this brought my swap partition online - and in the process brough memory management in KDE under control - going from 480MB usage when idle to 90 - 96MB. While all in all is a lot easier to live with.
But this time round, fstab looks OK - yet my swap partition still isn't being used - and I am back up to and stuck at 480MB (of 512MB) for avereage/idle usage.
My Fstab file currently looks like this:
/dev/hda4 / reiserfs defaults,noatime,notail 0 0
/dev/hda2 none swap defaults 0 0
none /proc proc defaults 0 0
none /proc/bus/usb usbfs devmode=0666 0 0
none /dev/pts devpts mode=0622 0 0
none /sys sysfs defaults 0 0
/dev/hda3 /home reiserfs defaults,noatime,notail 0 0
# Dynamic entries
/dev/hda1 /mnt/hda1 ntfs noauto,users,exec,ro,umask=0222 0 0
/dev/sda1 /mnt/sda1 ntfs noauto,users,exec,ro,umask=0222 0 0
/dev/cdrom /mnt/cdrom udf,iso9660 noauto,users,dev,ro 0 0
/dev/floppy /mnt/floppy vfat,ext2,hfsplus noauto,users,dev 0 0[
My guess is that Mepis is doing some kind of dynamic disk mounting stuff - and has pretty much taken to ignoring fstab.
swapon -s reports:
Filename Type Size Used Priority
/dev/hda2 partition 996020 0 -1
So hda2 is recognised as swap. It just isn't being used.
What on Earth I wonder is going on?
GJ
It's not being used because it doesn't need it yet.
Start opening stuff and you will see if it uses it or not.
raid517
10-12-2004, 03:35 PM
I have done - I've tried recording a video stream from my TV card - and it didn't get touched - besides which performance really, really sucked.
I know it's not normal to be using 480MB of physical memory when running idle - as most distributions are happy with about 90 to 200MB - depending on what's running.
Besides which on the previous install of Mepis - as I said - I was able to get the swap partition running - and I could actually see with my own eyes that this caused the physical memory to drop from 480MB to that "magic" 90 to 96MB usage mark when idle.
In other words I doubt it is really something I am just imagining.
Swap is effectively *never* being acessed.
GJ
ph34r
10-12-2004, 03:43 PM
You paid good money for RAM, you should be happy you are using it :)
Check out this link for a good article on how Linux manages memory...
http://forums.gentoo.org/viewtopic.php?t=175419
raid517
10-12-2004, 03:58 PM
Yes but I do like it to be used effciently - and even when using applications where you would 'expect' to generate some swap useage, none at all is generated. I tried ripping a 1 hour TV show - even in the best conditions with only 512MB of Ram you would expect this to generate some swap history. Currently after motitoring my swap history after all this time ripping a TV show, there is zero, nothing, nada in terms of swap history being generated.
Besides which I do know from past experience with proper configuration, it isn't beyond normal to have a KDE/Linux system idling between 90 and 128MB usage.
But to see no swap usage ever under any circumstances is not normal.
I am really quite sure about that. If I had over 1GB or more - then I wouldn't worry. I'd personally just turn the swap file off - as I would never really need it for home usage.
But I don't.
I should be able to see swap being used sometimes...
But not at all isn't normal.
GJ
raid517
10-12-2004, 04:11 PM
Well anyway I read that page and understand a little better. Things changed between 2.4x and 2.6x.
But nonetheless there is still no swap useage.
Even if I try for example searching a disk - which will always generally generate some swap useage - I can't see anything at all.
I don't mind if the system want's to use alll my memory for cahche - but I think this is confusing two issues. One is high memory usage (Ok I can live with that) and the other is zero swap usage under any conditions. (Which isn't normal).
I think focusing on the zero swap usage might be more productive.
GJ
bsm2001
10-12-2004, 04:22 PM
Why is that not normaI have 1Gig of ram and I think it is very nice that I dont have to wait for the system to access the swap to put unused cache on the swap. If the program is not being used any more why put it on swap why not just have it flush and be in your merry way.:D Unless you want an XP experience where everything goes to swap on startup and slows the system down.
raid517
10-12-2004, 04:32 PM
Well I don't have 1GB of Ram. Like I said I think we are confusing issues here. I cannot do anything no matter how intensive to make the system access swap space. Even if I rip a TV show, search a harddisk and start playing some kind of media/music file at the same time, swap is literally never touched.
We are talking about what is the difference between normal and abnormal behavour?
Currently I might as well not have a swap partition - because it is just not being used under any circumstances.
If you can think of a scenario which would normally force it to be used, I would happily try.
I'm open to ideas.
GJ
bsm2001
10-12-2004, 04:38 PM
Try compiling KDE from Scratch and see if that works for you.
raid517
10-12-2004, 04:41 PM
Lol... Your playing with me... I remember my Gentoo days only too well - and I'm not in a hurry to repeat that again. :D
That would use a lot of memory... It would potentially use a lot of swap too, It wwould also eat up a vast amount of time. But surely there are faster ways to test if a swap partition is active and in use?
GJ
bsm2001
10-12-2004, 07:49 PM
open up every program that you have.
raid517
10-12-2004, 07:53 PM
Now you are just teasing.
I mean surely there's some way to test from the command line that swap is working?
GJ
bsm2001
10-12-2004, 07:59 PM
Not trying to tease; maybe try to tar a dvd to your home partition?
Alex Cavnar, aka alc6379
10-13-2004, 02:20 PM
I remember once upon a time I saw a kernel module that was used as an example in the book Linux Device Drivers from O'Reilly. It was basically a device interface to the system's physical memory. Perhaps if you could find and configure that (I don't know what the copyright limitations were on that code, being produced by O'Reilly, et al. )
Whatever the memory device was (I'll say it was /dev/memory), you could write to it as if it were a normal file. Perhaps, there could be some way to use something like that, fill up your physical memory, and force it to start hitting the swap.
raid517
10-13-2004, 02:25 PM
This all seems a little extreme. Maybe I will just buy another 512MB of Ram and forget about swap space anyway.
GJ
Alex Cavnar, aka alc6379
10-13-2004, 05:16 PM
Originally posted by raid517
This all seems a little extreme. Maybe I will just buy another 512MB of Ram and forget about swap space anyway.
GJ
Go ahead and buy the memory, but don't factor out swap space, as I've heard stories of some OSes barfing when they don't have it, as a lot of OSes depend on it being there, whether they use it or not.
justlinux.com
Copyright 2007 Jupitermedia Corporation All Rights Reserved.