From owner-freebsd-hackers Thu Jun 6 6:20:46 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from bugz.infotecs.ru (bugz.infotecs.ru [195.210.139.22]) by hub.freebsd.org (Postfix) with ESMTP id 7361F37B408 for ; Thu, 6 Jun 2002 06:20:39 -0700 (PDT) Received: (from vel@localhost) by bugz.infotecs.ru (8.11.6/8.11.4) id g56DKLg25760; Thu, 6 Jun 2002 17:20:21 +0400 (MSD) (envelope-from vel) Date: Thu, 6 Jun 2002 17:20:20 +0400 From: "Eugene L. Vorokov " To: Stephen Montgomery-Smith Cc: freebsd-hackers@freebsd.org Subject: Re: allocating memory Message-ID: <20020606132020.GA25708@bugz.infotecs.ru> References: <3CFEEB99.AEDC5DB9@math.missouri.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1251 Content-Disposition: inline In-Reply-To: <3CFEEB99.AEDC5DB9@math.missouri.edu> User-Agent: Mutt/1.3.28i Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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