Re: Largest size array in Gnat 2005 for the PC?
- From: Ludovic Brenta <ludovic@xxxxxxxxxxxxxxxxxx>
- Date: Tue, 30 Oct 2007 02:47:40 -0700
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.
.
- Follow-Ups:
- Re: Largest size array in Gnat 2005 for the PC?
- From: Georg Bauhaus
- Re: Largest size array in Gnat 2005 for the PC?
- References:
- Largest size array in Gnat 2005 for the PC?
- From: ME
- Re: Largest size array in Gnat 2005 for the PC?
- From: Pascal Obry
- Largest size array in Gnat 2005 for the PC?
- Prev by Date: Re: Largest size array in Gnat 2005 for the PC?
- Next by Date: Problem with GNAT GPL 2007.1 win32Ada bindings
- Previous by thread: Re: Largest size array in Gnat 2005 for the PC?
- Next by thread: Re: Largest size array in Gnat 2005 for the PC?
- Index(es):
Relevant Pages
|