2001-12-02 17:08:57

by Edouard Gomez

[permalink] [raw]
Subject: VM Problem : persistent swap cache

Hi,

I've noticed something stange about the 2.4.16 VM. When I use some apps
which require a lot of memory (Like Unreal Tournament + Mozilla ...) at the same
time, VM allocates memory from the swap space. That's normal, but when I quit
one or more of those apps : the swap cache is not freed.

Here you have /proc/meminfo after having played UTournement + Divx Watching
+ mozilla and quit UT :

total: used: free: shared: buffers: cached:
Mem: 394809344 154902528 239906816 0 6422528 98713600
Swap: 139788288 21127168 118661120
MemTotal: 385556 kB
MemFree: 234284 kB
MemShared: 0 kB
Buffers: 6272 kB
Cached: 91544 kB
SwapCached: 4856 kB
Active: 107300 kB
Inactive: 20776 kB
HighTotal: 0 kB
HighFree: 0 kB
LowTotal: 385556 kB
LowFree: 234284 kB
SwapTotal: 136512 kB
SwapFree: 115880 kB

As you can see, there's 20Mo of swap though lot of free RAM is available.
The strange thing is that this 20Mo keeps growing with the time and are
never freed.

My system configuration is :

CPU : PentiumIII
RAM : 384Mo SDRAM PC133
Kernel : 2.4.16 (marcelo tree)
.config: see attachment

I'm currently trying to see what part of the VM can cause this strange
behaviour. I know the change has been done between 2.4.14 and 2.4.15/16
because 2.4.14 has never done that. But I'm not a kernel hacker so i
think it's better to do a bug report and let the real hackers do their
job :-)

--
Edouard Gomez
http://perso.wanadoo.fr/ed.gomez


Attachments:
(No filename) (1.52 kB)
config-2.4.16 (20.72 kB)
Download all attachments

2001-12-03 08:51:54

by Jose Luis Domingo Lopez

[permalink] [raw]
Subject: Re: VM Problem : persistent swap cache

On Sunday, 02 December 2001, at 18:08:02 +0100,
Edouard Gomez wrote:

> Hi,
> [...]
> As you can see, there's 20Mo of swap though lot of free RAM is available.
> The strange thing is that this 20Mo keeps growing with the time and are
> never freed.
>
Linux's VM doesn't try to free used swap space, even there is plenty os
physical RAM available. If there are pages on swap, that is because at
some point in time those pages where considered "not used", and were
written to disk. If those pages are never reused, they stay where they
currently are, because it is the most interesting thing to do performace
wise. Trying to keep swap=0 could cause some ping-pong effect under some
workloads, with heavy access to disk, that are too slow to be accesed
more than strictly necessary.

--
Jos? Luis Domingo L?pez
Linux Registered User #189436 Debian Linux Woody (P166 64 MB RAM)

jdomingo EN internautas PUNTO org => ? Spam ? Atente a las consecuencias
jdomingo AT internautas DOT org => Spam at your own risk