Swap space being used for disk cache?

From: Nick Battle (nick.battle_at_UNSPAMuk.consulting.fujitsu.com)
Date: 09/29/03


Date: Mon, 29 Sep 2003 13:21:06 +0100

I've noticed recently that I sometimes get very high usage of my swap
segment. Investigating this a bit further (with the free command), it
looks like the swap space is being allocated for cache blocks. Is there
any point in caching disk blocks in pages that are paged out?

This doesn't happen all the time. It seems to start when I run a JRE
(through Mozilla or Konq), though it doesn't always happen. The swap
usage stays high after I've exited all programs (including KDE), though
perhaps this is what you'd expect if its cache. Restarting KDE seems to
clear the swapped usage again though...

I've got ~320Mb RAM and ~80Mb swap (yes, I know that's small), so most
of the time I get no swap usage at all since I don't run many programs
concurrently. Typically, I might have ~100Mb of used memory, a small
amount of buffer space, a larger amount of cache (but less than the
total RAM), a bit of free memory and no swap.

Is this as expected? Is the problem with the JRE (I'm using the IBM Java
1.4 that comes with 8.2 IIRC) or the kernel - or something else!

(SuSE 8.2, 2.4.20 kernel)

-- 
Cheers,
-nick


Relevant Pages

  • [RFC][PATCH 5/6] memcg: mem+swap controller
    ... This patch implements per cgroup limit for usage of memory+swap. ... memory usage is limited by memory.limit_in_bytes. ... usage of swap, a process can exhaust all the swap ...
    (Linux-Kernel)
  • [RFC][PATCH 5/6] memcg: mem+swap controller
    ... This patch implements per cgroup limit for usage of memory+swap. ... usage of swap, a process can exhaust all the swap ... struct res_counter res; ...
    (Linux-Kernel)
  • [PATCH 7/9] memcg : mem+swap controlelr core
    ... This patch implements per cgroup limit for usage of memory+swap. ... usage of swap, a process can exhaust all the swap ... struct res_counter res; ...
    (Linux-Kernel)
  • [RFC][PATCH 5/5] memcg : mem+swap controller
    ... This patch implements per cgroup limit for usage of memory+swap. ... memory usage is limited by memory.limit_in_bytes. ... usage of swap, a process can exhaust all the swap ...
    (Linux-Kernel)
  • Re: [RFC][PATCH 5/6] memcg: mem+swap controller
    ... This patch implements per cgroup limit for usage of memory+swap. ... memory usage is limited by memory.limit_in_bytes. ... usage of swap, a process can exhaust all the swap ... charged as page and memsw. ...
    (Linux-Kernel)