From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,f479f3331eef5353 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news2.google.com!news.glorb.com!wn14feed!worldnet.att.net!bgtnsc04-news.ops.worldnet.att.net.POSTED!53ab2750!not-for-mail Newsgroups: comp.lang.ada From: anon@anon.org (anon) Subject: Re: Size of Vector limited to 1024 MB of Heap Size Reply-To: anon@anon.org (anon) References: X-Newsreader: IBM NewsReader/2 2.0 Message-ID: Date: Tue, 24 Jun 2008 22:53:02 GMT NNTP-Posting-Host: 12.65.192.196 X-Complaints-To: abuse@worldnet.att.net X-Trace: bgtnsc04-news.ops.worldnet.att.net 1214347982 12.65.192.196 (Tue, 24 Jun 2008 22:53:02 GMT) NNTP-Posting-Date: Tue, 24 Jun 2008 22:53:02 GMT Organization: AT&T Worldnet Xref: g2news1.google.com comp.lang.ada:855 Date: 2008-06-24T22:53:02+00:00 List-Id: Adjust your heap size in the linking phase. In , Dennis Hoppe writes: >Hi, > >my machine has 4 GB of RAM and I am wondering, why I can't use >at least 2 or 3 GBytes to run an Ada program. It seems, that my >Ada Compiler (Gnat 4.4.0) limit the memory to 2 GB per default. >Is it possible to allocate more than 2 GB? > >Here is a simple example of an "evil" vector, that gains >more memory in each pass. The program terminates exactly at >1024 MB of used Heap memory. > > >with Ada.Containers.Vectors; > >procedure Heap is > package Generic_Vector is new Ada.Containers.Vectors > (Element_Type => Integer, Index_Type => Natural); > > Evil_Vector : Generic_Vector.Vector; >begin -- Heap > loop > Generic_Vector.Append (Evil_Vector, Integer'Last); > end loop; >end Heap; > > >heap(6374) malloc: *** mmap(size=2147487744) failed (error code=12) >*** error: can't allocate region >*** set a breakpoint in malloc_error_break to debug > >raised STORAGE_ERROR : heap exhausted > > >I could not find a suitable Compiler switch or a parameter, that >can be set for the operating system (linux). "ulimit -v" is already >set to unlimited. > >"gnatmem" reports, that my water mark with 1024 MB is reached, but >the final water mark is, needless to say, higher. > > >Best regards, > Dennis Hoppe