malloc(), virtual memory

hosking at convexs.UUCP hosking at convexs.UUCP
Tue Sep 17 16:21:00 AEST 1985


> Since as distributed 4.2 has a per-process VM limit of 6M, you cannot
> allocate more than 4M with malloc.   (Of course  if you  raise the VM
> nlimits you can get as much space as you like, provided  you have lots
> of paging space.)

It turns out to be  pretty trivial  to raise  this limit  if you have
source;  mostly  just  changing  a  few  parameters  in /sys/h/dmap.h
around:  DMMIN, DMMAX, DMTEXT, and NXDAD.   Unfortunately, the proper
values to change them to are not intuitively obvious, and will depend
upon subtle things like the size of your swap space, etc.  

Another  not  so obvious  problem with  this is  that if  your 200 MB
program  core dumps,  your disks  will fill  up in  a hurry!   We got
around this by not doing core dumps for programs  > 32  MB unless the
user had done the appropriate setrlimit call first.   This helps, but
still isn't a perfect solution.

Yet another problem is that it takes a LONG time to run  out of stack
space when running an infinitely recursive  program if  you allow 100
MB  of  stack!   We  kept the  default stack  limit of  1/2 MB, again
settable  via  setrlimit, and  only rarely  run into  cases where the
default's not enough.  Oddly enough, fsck was one of the things which
ran out of stack!
			Doug Hosking
			Convex Computer Corp.
			Richardson, TX
			{allegra, ihnp4,uiucdcs}!convex!convexs!hosking



More information about the Comp.unix mailing list