2002-04-18 09:22:23

by Tony Clarke

[permalink] [raw]
Subject: VM Related question


I have noticed with my current kernel that after the system is idle for
a while, say 10 hours or
so, that everything seems to be swapped out to disk. So when I come in
the next morning
it starts swapping everything like crazy in from disk. Is this a known
characteristic of the
VM. I seem to remember this with all 2.4 kernels tried to date.

Whats the point of swapping out to disk in circumstances like this?

Currently I am using 2.4.18-rc2-ac2, with apps like mozilla, dozen
xterms, xemacs, staroffice etc.

Cheers,
Tony.


2002-04-18 12:46:46

by Helge Hafting

[permalink] [raw]
Subject: Re: VM Related question

Tony Clarke wrote:
>
> I have noticed with my current kernel that after the system is idle for
> a while, say 10 hours or
> so, that everything seems to be swapped out to disk. So when I come in
> the next morning
> it starts swapping everything like crazy in from disk. Is this a known
> characteristic of the
> VM. I seem to remember this with all 2.4 kernels tried to date.
>
> Whats the point of swapping out to disk in circumstances like this?
>
> Currently I am using 2.4.18-rc2-ac2, with apps like mozilla, dozen
> xterms, xemacs, staroffice etc.

The kernel makes no decision to swap just because you left the
machine. But your distro probably runs "updatedb" at night.
Updatedb reads all the directories in all your filesystems, so
it tends to use a lot of cache. This activity pushes
lots of other stuff into swap.

You may of course change your crontab to runn updatedb less
often, or configure updatedb to skip directory
trees where you expect little change. (/usr perhaps...)

Helge Hafting

2002-04-18 15:07:43

by Tony Clarke

[permalink] [raw]
Subject: Re: VM Related question


>>I have noticed with my current kernel that after the system is idle for
>>a while, say 10 hours or
>>so, that everything seems to be swapped out to disk. So when I come in
>>the next morning
>>it starts swapping everything like crazy in from disk. Is this a known
>>characteristic of the
>>VM. I seem to remember this with all 2.4 kernels tried to date.
>>
>>Whats the point of swapping out to disk in circumstances like this?
>>
>>Currently I am using 2.4.18-rc2-ac2, with apps like mozilla, dozen
>>xterms, xemacs, staroffice etc.
>>
>
>The kernel makes no decision to swap just because you left the
>machine. But your distro probably runs "updatedb" at night.
>Updatedb reads all the directories in all your filesystems, so
>it tends to use a lot of cache. This activity pushes
>lots of other stuff into swap.
>
Yep. That makes sense. /proc/slabinfo looks like

inode_cache 60311 60312 512 8616 8616 1
dentry_cache 60301 63930 128 2131 2131 1
buffer_head 35115 40620 128 1348 1354 1

this is on a 256mb machine.

Would I be right in saying that the only way that memory gets reclaimed
, is by some process requesting memory
or by some process waking up and having a load of page faults?

Cheers,
Tony.


2002-04-18 17:35:36

by Torrey Hoffman

[permalink] [raw]
Subject: RE: VM Related question

Tony Clarke wrote:

> I have noticed with my current kernel that after the system
> is idle for
> a while, say 10 hours or
> so, that everything seems to be swapped out to disk. So when
> I come in
> the next morning
> it starts swapping everything like crazy in from disk.

Probably what is happening is that in the middle of the night,
your distribution runs a cron job like "slocate" or "medusa"
which scans through your hard drive. Other distros do security
checks for world-writable files and many other things...

This heavy read activity fills up a lot of buffers and causes
your apps to be swapped out.

Torrey

[email protected]