Subject: kern/1460: swap leakage
To: None <gnats-bugs@gnats.netbsd.org>
From: Simon J. Gerraty <sjg@zen.void.oz.au>
List: netbsd-bugs
Date: 09/14/1995 23:53:16
>Number:         1460
>Category:       kern
>Synopsis:       swap space is not recovered.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people (Kernel Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Sep 14 10:05:02 1995
>Last-Modified:
>Originator:     Simon J. Gerraty
>Organization:
Zen Programming...
>Release:        95-08-18
>Environment:
	
System: NetBSD zen.void.oz.au 1.0A NetBSD 1.0A (ZEN) #0: Fri Aug 18 18:59:14 EST 1995 root@zen.void.oz.au:/f1/usr.src/sys/arch/i386/compile/ZEN i386


>Description:
	
zen is an i486DX33 with 16M ram and just under 60M swap.
It has been up 27 days (since installing 95-08-18 kernel).
While investigating why zen was running like a dog... I noticed that I had
no swap space left:

sjg:9104$ pstat -s
Device      1K-blocks     Used    Avail Capacity  Type
/dev/wd0b       32640    32628       12   100%    Interleaved
/dev/sd0b       24488    24468       20   100%    Interleaved
/dev/sd1b           0  *** not available for swapping ***
/dev/sd2b       32668  *** not available for swapping ***
Total           57128    57096       32   100%

A quick look through the process table showed netscape at 16M and
emacs at 6M as the only serious memory hogs.  I terminated netscape
and recovered a small amount of swap.

sjg:9106$ pstat -s 
Device      1K-blocks     Used    Avail Capacity  Type
/dev/wd0b       32640    32036      604    98%    Interleaved
/dev/sd0b       24488    22516     1972    92%    Interleaved
/dev/sd1b           0  *** not available for swapping ***
/dev/sd2b       32668  *** not available for swapping ***
Total           57128    54552     2576    95%

No where near 16M.

I terminated emacs and got back some more...

$ pstat -s 
Device      1K-blocks     Used    Avail Capacity  Type
/dev/wd0b       32640    29268     3372    90%    Interleaved
/dev/sd0b       24488    17556     6932    72%    Interleaved
/dev/sd1b           0  *** not available for swapping ***
/dev/sd2b       32668  *** not available for swapping ***
Total           57128    46824    10304    82%

Much better.  I stoped/started xconsole which at 3M was next.
And so on.

At this point, top and ps suggest that 28M worth of swap should be in
use. Yet pstat -s says 40M.

I've been running this sort of load for ages, and never noticed total
swap usage exceed 50% before.

It would appear there is a leak somewhere.

>How-To-Repeat:
	
>Fix:
	
>Audit-Trail:
>Unformatted: