2001-11-17 00:43:33

by Justin Piszcz

[permalink] [raw]
Subject: Swap Usage with Kernel 2.4.14

Regular usage on my box, launching netscape, opera, pan, xchat, gaim;
the kernel eventually digs into swap.

However, the swap is never released?

Mem: 900596K av, 185896K used, 714700K free, 0K shrd, 4172K
buff
Swap: 2048276K av, 63728K used, 1984548K free 91176K
cached

Are there any settings I should have set or be aware of?

I current use 4GB support, 1GB of ram, 2GB of swap.

Having 1GB, I thought I had enough memory for basic operations without
the disk swapping like mad.


2001-11-17 02:13:46

by Mike Fedyk

[permalink] [raw]
Subject: Re: Swap Usage with Kernel 2.4.14

On Fri, Nov 16, 2001 at 07:42:29PM -0500, war wrote:
> Regular usage on my box, launching netscape, opera, pan, xchat, gaim;
> the kernel eventually digs into swap.
>
> However, the swap is never released?
>
> Mem: 900596K av, 185896K used, 714700K free, 0K shrd, 4172K
> buff
> Swap: 2048276K av, 63728K used, 1984548K free 91176K
> cached
>
> Are there any settings I should have set or be aware of?
>
> I current use 4GB support, 1GB of ram, 2GB of swap.
>
> Having 1GB, I thought I had enough memory for basic operations without
> the disk swapping like mad.

run top and change it to show the "swap" field. Now check to see which
processes are in swap...

Does anyone know another way to get this information? I didn't find
anything in ps that would help... :(

Mike

2001-11-17 11:20:50

by Alvaro Lopes

[permalink] [raw]
Subject: Re: Swap Usage with Kernel 2.4.14

On S?b, 2001-11-17 at 00:42, war wrote:
> Regular usage on my box, launching netscape, opera, pan, xchat, gaim;
> the kernel eventually digs into swap.
>
> However, the swap is never released?
>
> Mem: 900596K av, 185896K used, 714700K free, 0K shrd, 4172K
> buff
> Swap: 2048276K av, 63728K used, 1984548K free 91176K
> cached
>
> Are there any settings I should have set or be aware of?
>
> I current use 4GB support, 1GB of ram, 2GB of swap.
>
> Having 1GB, I thought I had enough memory for basic operations without
> the disk swapping like mad.
>

AFAIK with 2.4.14 processes can be in memory and swap at the same time.

> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/


2001-11-17 14:59:55

by Ed Tomlinson

[permalink] [raw]
Subject: Re: Swap Usage with Kernel 2.4.14

> I current use 4GB support, 1GB of ram, 2GB of swap.
>
> Having 1GB, I thought I had enough memory for basic operations without
> the disk swapping like mad.

In 2.4.14 linux leave pages in swap when swaping in. This is a win when
the page has not been changed and there is memory pressure. This behavior
is maintained until swap is 50% full. An this point linux starts releasing
swap pages at swapin.

In short linux keeps pages in swap and memory to perform better but starts
releasing swap pages when swap start filling.

Ed Tomlinson

2001-11-17 15:05:25

by Ed Sweetman

[permalink] [raw]
Subject: Re: Swap Usage with Kernel 2.4.14

On Saturday 17 November 2001 06:18, Alvaro Lopes wrote:
> On S?b, 2001-11-17 at 00:42, war wrote:
> > Regular usage on my box, launching netscape, opera, pan, xchat, gaim;
> > the kernel eventually digs into swap.
> >
> > However, the swap is never released?
> >
> > Mem: 900596K av, 185896K used, 714700K free, 0K shrd, 4172K
> > buff
> > Swap: 2048276K av, 63728K used, 1984548K free 91176K
> > cached
> >
> > Are there any settings I should have set or be aware of?
> >
> > I current use 4GB support, 1GB of ram, 2GB of swap.
> >
> > Having 1GB, I thought I had enough memory for basic operations without
> > the disk swapping like mad.
>
> AFAIK with 2.4.14 processes can be in memory and swap at the same time.
>

look at swap cached in /proc/meminfo that will tell you what is
mirrored.
Also, your box may not be actually doing much swapping if any at all. vmstat
will tell if you're actually doing any swapping at a given time.
Allocation may carry over to swap, but it doesn't effect performance in any
way in doing so. That's why looking at anything but vmstat really wont tell
you much about what's actually being used in swap.

2001-11-17 21:44:03

by Mike Fedyk

[permalink] [raw]
Subject: Re: Swap Usage with Kernel 2.4.14

On Sat, Nov 17, 2001 at 10:05:02AM -0500, safemode wrote:
> Also, your box may not be actually doing much swapping if any at all. vmstat
> will tell if you're actually doing any swapping at a given time.
> Allocation may carry over to swap, but it doesn't effect performance in any
> way in doing so. That's why looking at anything but vmstat really wont tell
> you much about what's actually being used in swap.

procinfo will also list the number of swap(in|out) since the last reboot...