LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] swap

[ILUG] swap

Niall O Broin niall at linux.ie
Fri Apr 29 14:15:33 IST 2005


On 29 Apr 2005, at 13:54, Pat wrote:

>>> searching i noticed that both "free" & xosview show that it's not
>>> using any
>>> swap memory. I'm running SuSE 9.2 & set up a swap of 1Gb using YAST &
>>> later
>>> had a go at setting it up at the command line with "makeswap -c"
>>> followed by "swapon /dev/hda1" but no joy. I have been doing a little
>>> tweeking lately using YAST but cant think what i could do to stop it
>>> using
>>> swap memory. Any ideas or suggestions would be very welcome.
>>
>> What happens when you do   swapon /dev/hda1   ?
>>
>>
>> Niall
>  Well the machine didn't complain when i did swapon /dev/hda1, so i 
> assumed
> all was ok & the swap partition showed up when i ran the free command, 
> but no
> swap is being used

Swap is only used when it's needed. If you have a swap partition made, 
and in use, and free shows it, it will be used if needed. If you want 
to see your swap being used, save this

#include <stdlib.h>

int main()

{
   int megs = 512;
   free(calloc(megs, 1048576));
   exit(0);
}

as, say, gobble.c and compile it with   cc -o gobble gobble.c

changing the value of megs to change how many megabytes it allocates 
and then do

free; ./gobble; free

and you should see some swap usage, unless you have gobs of memory, in 
which case, increase megs.


Niall






More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


Maintained by the ILUG website team. The aim of Linux.ie is to support and help commercial and private users of Linux in Ireland. You can display ILUG news in your own webpages, read backend information to find out how. Networking services kindly provided by HEAnet, server kindly donated by Dell. Linux is a trademark of Linus Torvalds, used with permission. No penguins were harmed in the production or maintenance of this highly praised website. Looking for the Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!
RSS Version
Powered by Dell