2004-06-07 22:34:07

by Hal Nine

[permalink] [raw]
Subject: Flushing the swap

Is there any way of making linux flush out all pages out of swap
space? I want to have 0K of used swap space.

h9


2004-06-07 22:45:31

by Bernd Petrovitsch

[permalink] [raw]
Subject: Re: Flushing the swap

On Tue, 2004-06-08 at 00:34, Hal Nine wrote:
> Is there any way of making linux flush out all pages out of swap
> space? I want to have 0K of used swap space.

swapoff -a

Bernd
--
Firmix Software GmbH http://www.firmix.at/
mobil: +43 664 4416156 fax: +43 1 7890849-55
Embedded Linux Development and Services


2004-06-07 22:50:34

by Björn Schmidt

[permalink] [raw]
Subject: Re: Flushing the swap

Hal Nine wrote:
> Is there any way of making linux flush out all pages out of swap
> space? I want to have 0K of used swap space.

swapoff -a
swapon -a


--
Greetings
Bjoern Schmidt

2004-06-07 23:03:03

by Arthur Perry

[permalink] [raw]
Subject: Re: Flushing the swap

Not to be fecicious, you can reboot.

But if this is not good enough, you can try this:

swapoff -a
swapon -a

This may take a while if your system is busy and a lot of RAM has been used.
It especially will take a long time if your system was dipping into swap because an active process really needed that extra ram.

You can kill off as many memory hungry processes as possible first, to try and do this as painlessly as possible.

My thought is this: if she wants swap, give her swap! It beats a diamond ring.

____________Arthur Perry________________
| Your friendly neighborhood Linux guy |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Registered Pine user .. again..




On Mon, 7 Jun 2004, Hal Nine wrote:

> Is there any way of making linux flush out all pages out of swap
> space? I want to have 0K of used swap space.
>
> h9
> -
> 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/
>

2004-06-07 23:13:22

by Andreas Schwab

[permalink] [raw]
Subject: Re: Flushing the swap

Hal Nine <[email protected]> writes:

> Is there any way of making linux flush out all pages out of swap
> space? I want to have 0K of used swap space.

# swapoff -a

Andreas.

--
Andreas Schwab, SuSE Labs, [email protected]
SuSE Linux AG, Maxfeldstra?e 5, 90409 N?rnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."

2004-06-07 23:23:27

by Chris Wedgwood

[permalink] [raw]
Subject: Re: Flushing the swap

On Mon, Jun 07, 2004 at 06:34:59PM -0400, Hal Nine wrote:

> Is there any way of making linux flush out all pages out of swap
> space? I want to have 0K of used swap space.

as about 314 people already said 'swapoff -a' will work, but more to
the point is you probably don't want 0K of swap

2004-06-08 06:09:04

by Felipe Alfaro Solana

[permalink] [raw]
Subject: Re: Flushing the swap

On Mon, 2004-06-07 at 18:34 -0400, Hal Nine wrote:
> Is there any way of making linux flush out all pages out of swap
> space? I want to have 0K of used swap space.

Maybe?

# swapoff -a
# swapon -a


2004-06-08 12:27:42

by Horst H. von Brand

[permalink] [raw]
Subject: Re: Flushing the swap

Hal Nine <[email protected]> said:
> Is there any way of making linux flush out all pages out of swap
> space? I want to have 0K of used swap space.

What for? If they don't fit into RAM (likely, as swap is essentially "RAM
overflow"), you are toast anyway.

You might try swapoff(8)...
--
Dr. Horst H. von Brand User #22616 counter.li.org
Departamento de Informatica Fono: +56 32 654431
Universidad Tecnica Federico Santa Maria +56 32 654239
Casilla 110-V, Valparaiso, Chile Fax: +56 32 797513