Maximum amount of allocatable Virtual memory

John Tupper tupper at wanginst.UUCP
Mon Apr 7 05:52:31 AEST 1986


>. . . Does anyone know of how to figure out the MAXIMUM
>amount of virtual memory that can be allocated on ANY Unix machine?

>From my experience with 4.1 & 4.2bsd:

The only sure fire way that I would know of is to allocate until an allocation
fails (use a variation of the binary search to cut the number of allocates).

There is a problem with allocating everything you can get your hands on however.
Bsd will only allocate virtual memory if there is room in a swapping
partition to hold the allocated memory. Thus, allocating all the virtual
memory you can will fill the swapping partitions and seriously affect system
performance. It would be impossible to run two copies of your program at once.

Probably a better solution would be:
	1) Allocate on the fly, but allocate in big chunks to reduce to
	   number of allocates
	2) Let the user specify the initial amount of memory to be used
	   (possibly via an environment variable).
-- 
John Tupper                              tupper at wanginst        (Csnet)
Wang Institute of Graduate Studies       wanginst!tupper        (UUCP)
Tyng Road, Tyngsboro, MA 01879           (617) 649-9731



More information about the Comp.unix.wizards mailing list