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,6b3ebf057333800c X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!57g2000hsv.googlegroups.com!not-for-mail From: Ludovic Brenta Newsgroups: comp.lang.ada Subject: Re: Largest size array in Gnat 2005 for the PC? Date: Tue, 30 Oct 2007 02:47:40 -0700 Organization: http://groups.google.com Message-ID: <1193737660.539205.271270@57g2000hsv.googlegroups.com> References: <13idb3jbm28kfbe@corp.supernews.com><4726DD25.7080205@obry.net> NNTP-Posting-Host: 32.58.34.227 Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1193737660 7496 127.0.0.1 (30 Oct 2007 09:47:40 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 30 Oct 2007 09:47:40 +0000 (UTC) In-Reply-To: <4726DD25.7080205@obry.net> User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1,gzip(gfe),gzip(gfe) X-HTTP-Via: 1.1 SEVPXS01 Complaints-To: groups-abuse@google.com Injection-Info: 57g2000hsv.googlegroups.com; posting-host=32.58.34.227; posting-account=ps2QrAMAAAA6_jCuRt2JEIpn5Otqf_w0 Xref: g2news2.google.com comp.lang.ada:2633 Date: 2007-10-30T02:47:40-07:00 List-Id: Pascal Obry wrote: > ME a =E9crit : > > > What is the largest array (in storage units) that you can declare in Gn= at > > 2005 for the PC? > > Does pragma Storage_ size affect this and if so where would you place i= t in > > a procedure? > > It depends if you want to allocate it on the stack or on the heap. The > stack is often smaller but the size can be changed at link time. The > heap can use all the memory (physical + virtual) that you have on your > computer. There is a limit in the size allocated by a single object > imposed by the OS depending on the architecture (32bits / 64bits). In fact, if you use the heap with any recent operating system, you cannot use physical memory but only virtual memory; the operating system will then map some of that to physical memory, some to paging space, and the memory you don't actually read or write may remain uncommitted (not mapped to any physical storage). Of course, the amount of available virtual memory also depends on the other processes present in the system when you allocate your big array. The operating system may impose further restrictions on the amount of virtual memory you can use. Two examples: - it reserves part of the virtual address space for its own use; - there may be quotas that restrict any one user or process from using more than X megabytes of virtual memory. - on *nix systems, there may be a "ulimit -v" in effect. In short, the answer is: "it depends" :) -- Ludovic Brenta.