Re: Memory allocation on SUN (SUMMARY)

From: Chris Siebenmann (cks@hawkwind.utcs.toronto.edu)
Date: Thu Jan 09 1992 - 18:43:39 CST


[duncan@comp.vuw.ac.nz (Duncan McEwan):]
| > A couple of days ago, in <1992Jan6.003013.14429@comp.vuw.ac.nz> I posted
| > asking why SunOS (4.1.1 if it matters) seems to swap processes out after a
| > relatively short amount of idle time (~20-30 seconds).
gordoni@cs.adelaide.edu.au writes:
| It is probably no big deal.

 The ice is thin here; it is not at all obvious (at least to me)
just what ramifications this has and my belief is that it has
some bad side effects, at least on multiuser machines.

 First, the basics; this behavior is new in SunOS 4.1; before then,
things were only swapped out if they'd been sleeping for a number of
seconds *and* they had little memory, or memory was needed (or, in
SunOS 4.0.x, if pmegs were low). SunOS 4.1 changed this to just looking
for processes that had been sleeping for 20 seconds, and added the
idea of 'hard' and 'soft' swaps; a sleeping process is hard-swapped if
there is a memory shortfall, and soft-swapped otherwise.

 Unfortunately, the Sun code is heavily nested and not heavily
commented, so it's not clear just what the difference is between a
'hard' and a 'soft' swap. However, I suspect that a 'soft' swap makes
the pages involved prime candidates to be used by other processes. If
this is so, then because SunOS sets its desired free memory so low
('lots free' is 256K on our multiuser machines), any new program that
starts up while the system is busy will start taking memory from these
'swapped out' processes. When they want to run again, they have to
steal it back. Also, because of the buffer cache being merged into the
virtual memory system, any filesystem activity may eat up this memory
as well.

 Since Sun hasn't overhauled their monitoring tools (as far as I can
see) from the BSD ones, it's hard to validate or disprove this idea;
I'd love to, for example, be able to monitor just what the filesystem
cache is doing with memory. Better yet would be a tool that divided
real memory up into classes, and showed you a breakdown. Anyone know of
any?

--
	"This will be dynamically handled, possibly correctly, in 4.1."
		- Dan Davison on streams configuration in SunOS 4.0
cks@hawkwind.utcs.toronto.edu	           ...!{utgpu,utzoo,watmath}!utgpu!cks



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:06:33 CDT