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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham 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!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!198.186.194.249.MISMATCH!news-out.readnews.com!transit3.readnews.com!panix!newsfeed-00.mathworks.com!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Size of Vector limited to 1024 MB of Heap Size Date: Tue, 24 Jun 2008 16:38:31 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <2ad55f4f-a463-4542-aa76-b1b6d20d9168@d45g2000hsc.googlegroups.com> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls6.std.com 1214339912 11923 192.74.137.71 (24 Jun 2008 20:38:32 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Tue, 24 Jun 2008 20:38:32 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:09pKNr7MZLt1OiZlMP6bWqyV338= Xref: g2news1.google.com comp.lang.ada:850 Date: 2008-06-24T16:38:31-04:00 List-Id: Gene writes: > Your code thrashes the heap pretty hard. Containers doubles the size > of the vector's internal array each time it runs out. So the 2Gb > request means 1Gb is already in use. Dont' know about your malloc(), > but it's easy to see that a 1Gb allocated block in a 4Gb arena can > preclude a further 2Gb allocation. Good point. Note that when you grow from 1GB to 2GB, you have both allocated for the time it takes to copy the data over. That won't work if the user part of the address space is limited to 3GB. Some part of that 3GB is used for other stuff. Plus the heap might well be fragmented. A better test of how much you can allocate would allocate a whole bunch of smaller objects. - Bob