[comp.sys.next] Swapfile revisited

mfriedel@slate.mines.colorado.edu (Friedel Michael) (04/17/91)

In my last post I wasn't completely clear on what I actually
ment. I did know about the low-water mark, I wasn't aware 
that vm_stat only accounts for the real_memory. Does anyone
know of a way to get a statistic on the swap file, i.e how many 
pages are used in the file, how many are free, ....
I have the suspicion that the NeXT operating system seems to 
forget about some of the pages in the swapfile at times. When
I start a bunch of applications that use plenty of memory my
swap file grows to 40 meg and more. After I have successfully
exited those applications (Mathematica, ViewGif, Frame, just
to mention a view) and start of an application that definitely
does not need even close to that much memory (like Mail, Terminal
Edit) , it will make the swap file grow even bigger. Causing
my machine to crash at some point. Even if I don't excite all the
available diskspace the swap file seems to be rather fragmented and 
and the machine becomes very slow. I have also never observed the
swapfile to shrink. The only plausible reason for me for this kind
of behaviour would be if certain applications do not correctly 
deallocate memory when they quit, causing the operating system to
believe that that memory is still in use. I have tried a regular
C program with a few call malloc or calloc and exiting the prematurely,
that did not cause any of the above symptoms though. I haven't gotten
around trying a similar experiment with the vm_alloc and zone_alloc 
functions, or building an application in objective_c, to check if any
of those functions generate such behaviour. 
My question now is whether anybody else has experienced similar problems
with their swapfiles, or observed any of the above described behaviour.

Thanks Mike
-- 
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
No user serviceable part inside. Warranty void if opened
modified or tampered with. No batteries included.
*