malloc(), virtual memory

Jeff Anton anton at ucbvax.ARPA
Fri Sep 6 05:13:16 AEST 1985


In article <203 at cirl.UUCP> gary at cirl.UUCP (Gary Girzon) writes:
>I would appreciate some help on the following problem. When using
>malloc() in C ( runing 4.2 bsd ), I cannot allocate more than roughly
>4 megabytes. This seems to be limited by our core size. I would 
>like to know whether this limit can be extended to handle virtual
>memory on the VAX. Also, any information on how the C compiler deals with
>virtual memory (if at all) would be appreciated.

The C compiler does not bother with VMem knowledge except for its
own use.  You are probably encountering a limit imposed by malloc.
I'd suggest you try useing sbrk(2).  I recently needed a 6 Mbytes for
raster plotting and malloc complained but sbrk worked fine.  I don't
suggest running jobs that exceed system core size, but sometimes
we don't have any way around the matter.  You might also try out the
'limit' command in csh.  Check out sbrk(2), setrusage(2), and the
'obsolete' vadvise(2).  (vadvise is hidden in 4.2 for use by lisp,
and some CAD tools, and maybe apl; it might be named Ovadvise)
-- 
C knows no bounds.
					Jeff Anton
					U.C.Berkeley
					Ingres Group
					ucbvax!anton
					anton at BERKELEY.EDU



More information about the Comp.lang.c mailing list