[Techtalk] Mystery cache

David Sumbler david at aeolia.co.uk
Tue Apr 11 19:41:53 EST 2006


"Val Henson" <val.henson at gmail.com> writes:

> 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.

I'll try that, once the current operation ('apt-get install less') has
finished.  I just want to see how long it takes - so far it has got as
far as "Unpacking less" in 15 and a half hours!!!

>> 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?

Unfortunately not - this version is based on Debian 3.1.  Although
I've messed about quite a bit modifying an initrd to work on the Psion
7, I don't think I'm knowledgeable enough to attempt doing things from
scratch with a newer distro.

David

-- 

david at aeolia.co.uk



More information about the Techtalk mailing list