[Techtalk] Mystery cache

Val Henson val.henson at gmail.com
Tue Apr 11 09:53:53 EST 2006

On 4/9/06, David Sumbler <david at aeolia.co.uk> wrote:
> I have been trying to run Linux on a Psion 7 computer.  This is a kind
> of large hand-held with 16Mb RAM, and no hard drive, so it is using a
> CF card as main storage, and another (64Mb) CF card as swap.
> Obviously the swap is very slow.
> Trying to run apt-get I discovered that "Building Dependency Tree"
> takes well over 3 hours!  Having asked on an e-mail group if other
> people have this problem, one person running Linux on a Psion 5mx -
> basically a similar machine, also with 16Mb RAM - said that it takes
> less than a minute.
> Further investigation, reveals that, even immediately after booting,
> over 11Mb are cached.  I assume, therefore, that apt-get is using swap
> space because of this.  Running 'top' shows:

Swap cache is actually not your problem (at least not directly) - swap
cache reduces swap activity.  Swap cache is a note that a page that is
currently in memory matches a page already written to swap.  If that
page is not altered, then you don't have to write it out to swap again
if it is evicted from main memory.

> Mem: 14780k total, 14400k used, 380k free, 436k buffers
> Swap: 62952k total, 260k used, 62692k free, 11612 cached

This shows that you are only actually actively using 260k of your swap
- the "cached" part just means that if you were to have to swap out a
page from main memory, you wouldn't have to write it to swap.  Think
of it as a cache of pages that are already in main memory, on your
swap device.

Several things could be going on here.  One way to narrow down the
possibilities is to try booting with swap disabled - edit /etc/fstab -
and see if it's still really slow.  It looks like you might have just
barely enough memory to do this, especially if you only run one getty
and one shell.

> The kernel is version 2.4.27.

Oh.  2.4 is notoriously nondeterministic with regard to swap.  I don't
suppose a 2.6 kernel is available?


More information about the Techtalk mailing list