Date: Thu, 6 Jun 2002 17:20:20 +0400 From: "Eugene L. Vorokov " <vel@bugz.infotecs.ru> To: Stephen Montgomery-Smith <stephen@math.missouri.edu> Cc: freebsd-hackers@freebsd.org Subject: Re: allocating memory Message-ID: <20020606132020.GA25708@bugz.infotecs.ru> In-Reply-To: <3CFEEB99.AEDC5DB9@math.missouri.edu> References: <3CFEEB99.AEDC5DB9@math.missouri.edu>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Jun 05, 2002 at 11:56:57PM -0500, Stephen Montgomery-Smith wrote: > I have access to a rather large computer (3GB of RAM) and I would like > to write a program to access most of this memory. I find that I am > unable to malloc more than about 0.5 GB of memory, even if I do it in > small increments. Now I am trying mmap, and this lets me get to about > 2.5 GB of memory (again I ask for the memory in small increments). What > is it that causes these limitations? The 0.5G memory limit is most probably caused my your "datasize" limit, which you can see by typing "limits" on the shell. malloc() increases process heap size using sbrk() syscall, and datasize limit holds maximum heap size that can be set for a process that way. mmap() with MAP_ANON doesn't use sbrk() and allocates memory from global heap, so this way you can get as much memory as possble, AFAIK. However, don't forget that some memory is used by or reserved for the kernel. Regards, Eugene To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020606132020.GA25708>