From owner-freebsd-hackers Wed Jun 5 21:57: 9 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from sccmmhc01.mchsi.com (sccmmhc01.mchsi.com [204.127.203.183]) by hub.freebsd.org (Postfix) with ESMTP id 8F39137B401 for ; Wed, 5 Jun 2002 21:56:58 -0700 (PDT) Received: from math.missouri.edu ([12.216.240.219]) by sccmmhc01.mchsi.com (InterMail vM.4.01.03.27 201-229-121-127-20010626) with ESMTP id <20020606045657.IAXO2006.sccmmhc01.mchsi.com@math.missouri.edu> for ; Thu, 6 Jun 2002 04:56:57 +0000 Message-ID: <3CFEEB99.AEDC5DB9@math.missouri.edu> Date: Wed, 05 Jun 2002 23:56:57 -0500 From: Stephen Montgomery-Smith X-Mailer: Mozilla 4.79 [en] (X11; U; Linux 2.4.2 i386) X-Accept-Language: en MIME-Version: 1.0 To: freebsd-hackers@freebsd.org Subject: allocating memory Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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 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? Here is the kind of program I used to find these limits: #include #include #include #include #include #define size 100000000 #define nr 100 main() { char *a[nr]; unsigned int i, j; for (j=0;j