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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,d02eb5c33ac65d9 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-03-11 08:01:52 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: mheaney@on2.com (Matthew Heaney) Newsgroups: comp.lang.ada Subject: Re: Array and memory usage Date: 11 Mar 2003 08:01:52 -0800 Organization: http://groups.google.com/ Message-ID: <1ec946d1.0303110801.3c471b8c@posting.google.com> References: <1ec946d1.0303100713.7f7bcbb7@posting.google.com> NNTP-Posting-Host: 66.162.65.162 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1047398512 29268 127.0.0.1 (11 Mar 2003 16:01:52 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 11 Mar 2003 16:01:52 GMT Xref: archiver1.google.com comp.lang.ada:35204 Date: 2003-03-11T16:01:52+00:00 List-Id: Robert A Duff wrote in message news:... > > I thought it happened automatically. That is, if I say: > > X: array (1..100_000_000) of Integer; > > it would allocate 400,000,000 bytes of virtual memory, but only allocate > physical pages on demand. I believe that much works on Windows (without > calling windows-specific stuff like SEH). (Windows 2000, Windows XP.) > The problem I found was that it allocated 400,000,000 bytes of backing > store, which was annoying. > > Am I misinformed? Windows is going to commit all that memory up front, which (as Randy pointed out) will indeed allocate backing store. The solution is to "reserve" that range of virtual memory, without actually "committing" the pages (to physical memory). Then use SEH to "commit" the pages as necessary, when a page fault occurs.