comp.lang.ada
 help / color / mirror / Atom feed
From: Ludovic Brenta <ludovic@ludovic-brenta.org>
Subject: Re: Largest size array in Gnat 2005 for the PC?
Date: Tue, 30 Oct 2007 02:47:40 -0700
Date: 2007-10-30T02:47:40-07:00	[thread overview]
Message-ID: <1193737660.539205.271270@57g2000hsv.googlegroups.com> (raw)
In-Reply-To: <4726DD25.7080205@obry.net>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="us-ascii", Size: 1505 bytes --]

Pascal Obry wrote:
> ME a écrit :
>
> > What is the largest array (in storage units) that you can declare in Gnat
> > 2005 for the PC?
> > Does pragma Storage_ size affect this and if so where would you place it 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.




  reply	other threads:[~2007-10-30  9:47 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-30  4:00 Largest size array in Gnat 2005 for the PC? ME
2007-10-30  7:08 ` Martin Krischik
2007-10-30 12:27   ` Florian Weimer
2007-10-30 14:16   ` ME
2007-10-30 14:47     ` Pascal Obry
2007-10-30 18:58     ` Martin Krischik
2007-10-31  5:38       ` ME
2007-10-30 16:07   ` virtual memory, was " tmoran
2007-10-30 19:17     ` Martin Krischik
2007-10-30 20:35     ` Ludovic Brenta
2007-10-31  5:53   ` ME
2007-10-30  7:28 ` Pascal Obry
2007-10-30  9:47   ` Ludovic Brenta [this message]
2007-10-30 19:26     ` Georg Bauhaus
2007-10-30 20:17       ` Adam Beneschan
2007-10-30 22:53         ` tmoran
2007-10-30 23:39           ` Georg Bauhaus
2007-10-30 20:24       ` Adam Beneschan
2007-10-30 21:40         ` Georg Bauhaus
2007-10-30 21:48           ` Adam Beneschan
2007-10-30 21:50           ` Georg Bauhaus
2007-10-30 13:50   ` ME
2007-10-30 14:44     ` Pascal Obry
2007-10-30 15:00       ` Stefan Bellon
2007-10-30 15:16         ` Pascal Obry
2007-10-30 15:22           ` Stefan Bellon
2007-10-31  5:52         ` ME
2007-10-31  9:22           ` Stefan Bellon
2007-10-31 13:33             ` ME
2007-10-31 14:36               ` Stefan Bellon
2007-10-30 17:27 ` anon
2007-10-30 19:06   ` Adam Beneschan
2007-10-31  6:32 ` anon
2007-11-01  4:13   ` ME
2007-11-01  8:44     ` Stefan Bellon
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox