[comp.sys.hp] what is my swap used for ?

se@ikp.uni-koeln.de (Stefan Esser) (05/02/90)

I have upgraded our HP9000/835 to HP-UX 7.0 several month ago.
I shortly thereafter noticed the system running out of swap though the 
typical load hadn't changed. Especially annoying was the fact, that the 
compilers often failed when there was an even small load of batch jobs.

I got a version of William LeFebvre's utility 'top' that was patched 
for HP-UX. 'top' indicates, that programs fail due to lack of memory when 
the virtual memory usage just reaches 45 MB (the 'empty' system needs more 
then 15 MB, leaving 25 to 30 MB for user programs). The system is configured 
with about 70 MB of swap, one should be able to use about 75% of (= 53 MB)
(the rest being wasted because of the BSD-method of swap allocation).

To get an inside view of the Kernel I patched the BSD 4.3 'pstat' to work 
on the HP9000/835. I got reasonable values out of 'pstat -s', showing 
that after a program allocated all memory it could get, there were 
about 10 MB of 'free' swap. I made a further test, starting several 
instances of this program. Each of them was able to gather a small 
additional piece of memory, until the remaining 10 MB were completely 
used. 

I told the local HP support of my problem. 
They checked my configuration, told me "everything is all right" and
suggested, that I should get another disk drive. 
Its not so simple for me because we don't have the money. 

Now I am looking for information.

1) May be I am wrong and misinterpreting something.
2) Does the kernel prevent a single program from allocating all memory ?
3) Am I expecting to much from my system configured with 32 MB RAM and 
   70 MB swap, if I want to use more than 35 MB of virtual memory for
   user programs ?
4) Are there any utilities that let you monitor the kernel ?
5) Did anybody see the same kind of behavior on his system ?

If there is any interest in the patches to 'pstat', I'll make binary
and context diffs available via anonymous ftp. 
(I only spent 2 hours on them and didn't do anything to get the tty-stuff 
working) 

Thanks in advance,

Stefan Esser
-----------------------------------------------------------------------------
Stefan Esser, Institute of Nuclear Physics, University of Cologne, W. Germany
se@ikp.Uni-Koeln.DE
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++




--
-----------------------------------------------------------------------------
Stefan Esser, Institute of Nuclear Physics, University of Cologne, W. Germany
se@ikp.Uni-Koeln.DE
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

stroyan@hpfcso.HP.COM (Mike Stroyan) (05/05/90)

> To get an inside view of the Kernel I patched the BSD 4.3 'pstat' to work 
> on the HP9000/835. I got reasonable values out of 'pstat -s', showing 
> that after a program allocated all memory it could get, there were 
> about 10 MB of 'free' swap. I made a further test, starting several 
> instances of this program. Each of them was able to gather a small 
> additional piece of memory, until the remaining 10 MB were completely 
> used. 

You may want to debug that program and see how much memory malloc is
trying to sbrk().  I have heard that malloc asks for memory in larger
and larger chunks, proportional to the amount of memory it has already
allocated.  That last 20 byte malloc might be asking sbrk() for 16M.

Mike Stroyan, stroyan@hpfcla.hp.com

ken@hpubrcf.HP.COM (Ken Green) (05/08/90)

	It is possible that the kernal is limiting the amount of space used
	by your process.

	The kernal parameters maxdsiz, maxtsiz & maxssiz limit the data, text &
	stack sizes. These are also related to the parameters dmmax & dmmin.

	The system when allocating swap space firstly gives you chunk dmmin in
	size, the next piece will be twice that...etc untill you reach dmmax,
	there after dmmax size chunks are dished out. You can have a maximum
	of 21 chunks of swap space.

	If these parameters are not set up correctly you could get problems.

	Do you have multiple or single swap disks????????????????


				Ken Green
				--ukcrc--

-----------------------------------------------------------------------
This response does not represent the official position of, or statement by,
the Hewlett-Packard Company.  The above data is provided for informational
purposes only.  It is supplied without warranty of any kind.
-----------------------------------------------------------------------