HELP! Swap partition not being used!

HELP! Swap partition not being used!

Post by Ben Sandle » Thu, 02 Jul 1998 04:00:00



I have a new installation of RedHat 5.1 running on a P166 with 32MB
RAM.  Lots of things were breaking, and then someone discovered this:

Output from top:

6:41pm  up 15 days, 1 min,  2 users,  load average: 0.00, 0.00, 0.00
48 processes: 47 sleeping, 1 running, 0 zombie, 0 stopped
CPU states:  0.7% user,  1.5% system,  0.0% nice, 97.9% idle
Mem:   30844K av,  28496K used,   2348K free,  16432K shrd,   3416K buff
Swap:      0K av,      0K used,      0K free                 12376K
cached

So apparently our swap is not loaded or being used.  I have a swap
partition of 40MB on /dev/hda1, as fdisk reports, but it is not being
used.

What can I do about this (I really hope I don't have to reinstall
here...)?

Thanks in advance,
Ben

--
Ben Sandler
email me: sandler at ymail dot yu dot edu

"Windows is an operating system, not a religion."
- Ted Waitt, chairman of Gateway

 
 
 

HELP! Swap partition not being used!

Post by Jeffrey Moye » Thu, 02 Jul 1998 04:00:00


[snip]

Quote:> So apparently our swap is not loaded or being used.  I have a swap
> partition of 40MB on /dev/hda1, as fdisk reports, but it is not being
> used.

> What can I do about this (I really hope I don't have to reinstall
> here...)?

        try swapon /dev/hda1

This should be in your fstab, so it is loaded at boot time.  a line like
the following:

/dev/hda1       none    swap    sw

for a redhat installation.

-Phro

 
 
 

HELP! Swap partition not being used!

Post by Core » Sat, 04 Jul 1998 04:00:00



> I just installed RedHat 5.1 a couple of weeks ago. When I saw this post, I ran
> top, and sure enough -
> the swap partition is not being used! I hadn't noticed, because my notebook
> has 48 meg, and I obviously turn it off when I'm done. But top shows that I'm
> nearly
> maxed out with X, three xterms, and netscape all running at once.

> I've checked. The install put the swap partition in /etc/fstab, and
> /etc/rc.sysinitd runs
> "swapon -a" at boot time. I've manually done "ptrace swapoff -a", followed by
> "ptrace swapon -a".
> The swapoff() and  swapon() system calls succeed. If I run swapon a second time,
> I get
> "device busy",  so I assume the partition is now being used.

> As a cross-check, "free" and "cat /proc/meminfo" both say I have 64 meg of swap
> space
> allocated, and 0 bytes used. When I do "swapoff -a", they report 0 bytes
> allocated. When I
> do "swapon -a", they report 64 meg allocated. Always 0 bytes used.

Isn't linux' memory managenent great!  (c;

You want to use some of that swap, just to see it's actually there for
a reason?  -  Edit a large Gimp file along with all the other things
you mentioned above - hell - and why not compile your kernel as well ...
then you should see a peice of that swap being put to good use.
( and hear your drive chuggin' along as well )

Beers,

Corey

 
 
 

HELP! Swap partition not being used!

Post by Gary Bjerk » Sat, 04 Jul 1998 04:00:00




> > I just installed RedHat 5.1 a couple of weeks ago. When I saw this post, I ran
> > top, and sure enough -
> > the swap partition is not being used! I hadn't noticed, because my notebook
> > has 48 meg, and I obviously turn it off when I'm done. But top shows that I'm
> > nearly
> > maxed out with X, three xterms, and netscape all running at once.

> > -- snip --

> Isn't linux' memory managenent great!  (c;

> You want to use some of that swap, just to see it's actually there for
> a reason?  -  Edit a large Gimp file along with all the other things
> you mentioned above - hell - and why not compile your kernel as well ...
> then you should see a peice of that swap being put to good use.
> ( and hear your drive chuggin' along as well )

> Beers,

> Corey


Okay. So I dd'ed 32meg from /dev/zero to /tmp and tried to edit it. As you
predicted,it started swapping like crazy. I didn't wait for the edit to actually
present data,
I eventually killed it. Now there seems to about 14meg of swap in use, and I have
about 22.5 meg of physical memory free.

Before editing the huge file, about 46 meg of my 48 was in use. Now, a large chunk
seems to persist in swap. This now sounds like a tuning issue. At least, I'm aware
that there are some tuneables available. Short of reading the source code carefully,
is there
any place I can find a decent description of how to use them?

--
+--------------+
| Gary Bjerke  |

+--------------+

 
 
 

HELP! Swap partition not being used!

Post by Bob » Sun, 05 Jul 1998 04:00:00


Quote:> 6:41pm  up 15 days, 1 min,  2 users,  load average: 0.00, 0.00, 0.00
> 48 processes: 47 sleeping, 1 running, 0 zombie, 0 stopped
> CPU states:  0.7% user,  1.5% system,  0.0% nice, 97.9% idle
> Mem:   30844K av,  28496K used,   2348K free,  16432K shrd,   3416K buff
> Swap:      0K av,      0K used,      0K free                 12376K
> cached

> So apparently our swap is not loaded or being used.  I have a swap
> partition of 40MB on /dev/hda1, as fdisk reports, but it is not being
> used.
> Thanks in advance,
> Ben

> --
> Ben Sandler
> email me: sandler at ymail dot yu dot edu

try mkswap /dev/hda1
then try swapon
then take a look

when you congratulate yourself,

edit a line
/dev/hda1    swap   swap  defaults 1 1
into /etc/fstab
so it will be there when you reboot

bob

                              |  http://www.norcom.net.au
Yes, I am on the interthingy  |  If it aint broke, fix it, then it will be
--------------------------------------------------------------------------

 
 
 

HELP! Swap partition not being used!

Post by Core » Sun, 05 Jul 1998 04:00:00



> Okay. So I dd'ed 32meg from /dev/zero to /tmp and tried to edit it. As you
> predicted,it started swapping like crazy. I didn't wait for the edit to actually
> present data,
> I eventually killed it. Now there seems to about 14meg of swap in use, and I have
> about 22.5 meg of physical memory free.

> Before editing the huge file, about 46 meg of my 48 was in use. Now, a large chunk
> seems to persist in swap. This now sounds like a tuning issue. At least, I'm aware
> that there are some tuneables available. Short of reading the source code carefully,
> is there
> any place I can find a decent description of how to use them?

Well, first of all - that 'used' swap isn't just going to go away,
I mean, although top may say so much of it is 'used' , *none* of
it is being wasted - it's all right there for you if you suddenly decide
you really want to do that dd again - it'll go much quicker -
HOWEVER - as soon as that space is needed for some other use, the old
data that was there will be overwritten to store the next needed bit
of information.

To show I'm not just making this up - try a test in a somewhat
different situation:

do a: 'find / -name netscape'

wait, and listen to your drive go a' spinnin' .

after the command has finished do a:

'find / -name xterm'

now ... hey! why is your drive hardly churning? and why did it scan your
whole filesystem so quickly?! --

Cache baby.

Whatever (tiny) bit of memory that was used by the 'find' would still
be marked by the kernel as being 'used' - just for if you happen
to need it again - and it'll stay there until it eventually gets
swapped out with some other data.  The same thing basically happens
with the swap space.  So, what your seeing is definately not a
problem - quite the contrary, it's linux's kick ass memory utilization
displaying itself.

As for how to finer tune things by hand - check out 'memory-tuning.txt'
in /usr/src/linux/Documentation ( or wherever you put your kernel
source ). There really isn't *too* much info in this document, but
it's decent.

Beers!

Corey

 
 
 

HELP! Swap partition not being used!

Post by Tim J. Corcora » Tue, 07 Jul 1998 04:00:00



>> 6:41pm  up 15 days, 1 min,  2 users,  load average: 0.00, 0.00, 0.00
>> 48 processes: 47 sleeping, 1 running, 0 zombie, 0 stopped
>> CPU states:  0.7% user,  1.5% system,  0.0% nice, 97.9% idle
>> Mem:   30844K av,  28496K used,   2348K free,  16432K shrd,   3416K buff
>> Swap:      0K av,      0K used,      0K free                 12376K
>> cached

>> So apparently our swap is not loaded or being used.  I have a swap
>> partition of 40MB on /dev/hda1, as fdisk reports, but it is not being
>> used.
>> Thanks in advance,
>> Ben

>> --
>> Ben Sandler
>> email me: sandler at ymail dot yu dot edu

>try mkswap /dev/hda1
>then try swapon
>then take a look

>when you congratulate yourself,

>edit a line
>/dev/hda1    swap   swap  defaults 1 1
>into /etc/fstab
>so it will be there when you reboot

I am here to say this DOESN'T work all the time.  I am running slackware 3.5
on a PII 300 with 128MB of ram and can't get a swap device to show up if my
life counted on it.  I have done the mkswap and added the lines to
/etc/fstab.  I have looked in the /proc filesystem to find *NO* swap...ever.
When doing a 'swapon -s', it reports no swap devices setup.

Any other ideas?

-tJc

 
 
 

1. Using a swap partition and a swap file together?

Hi,

unfortunately the swap partition of my linux machine is too small for
some applications converting big images. Since it is impossible to
increase the swap partition or to add a swap partition I have the
question if it is possible to use a "hybrid" swap system by adding
a swap file (may be with lower priority). The swapon man page doesn't
give an answer for me.

Greetings

Jens

--
Dr. Jens Schleusener            T-Systems debis Systemhaus
phone: +49 (551) 709-2493       Solutions for Research GmbH
fax:   +49 (551) 709-2169       Bunsenstr.10

2. NT causes $10M loss [Was Uptime Discussion]

3. Why swap partition not swap file?

4. Mandrake 7.2 installation queries

5. Q: Why swap partition and not swap file???

6. Daylight time (label) but standard time (time)

7. SWAP PROBLEM: Swap not being used...

8. dial-in to CD-ROM Network

9. HELP: FreeBSD will not mount the /usr and swap partitions!

10. Why am I using lots of swap with plenty of RAM free?

11. HELP - am I SWAP-ping, how do I know?

12. update: using a partition for both linux and Windows swap

13. How to determine which partition(s) are being used for swap?