Re: Largest size array in Gnat 2005 for the PC?



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.

.



Relevant Pages

  • Re: I wiill start at the bottom
    ... I'm no expert either but my belief is that if the OS (or at least Windows) runs out of physical memory then it starts using lumps of HD space as virtual memory. ... Someone who knows more than me recommended that if using an old version of Windows where you explicitly specify virtual memory size and location, the operating system default is almost certainly inadequate. ...
    (rec.gambling.lottery)
  • Re: MSAS 2gb/3gb limit...
    ... You said that the memory an application can ... 2-3gb Virtual Memory. ... it also relates to recommended physical memory used by ... > This is because Windows as an operating system doesn't really like to page. ...
    (microsoft.public.sqlserver.olap)
  • Virtual Memory greater than 4096MB!
    ... windows XP x64 operating system running on AMD Athlon 64. ... as 4088MB despite the virtual memory still set to 10000MB! ...
    (comp.soft-sys.matlab)
  • Re: a big limit of mathematica?
    ... >>>amount of memory Mathematica declares it is going to ... >> That's not the way virtual memory works, at least on any decent operating ... I certainly wasn't talking about Windows, and the OP gave the indication ... >> by the operating system is determined dynamically and is limited only by ...
    (sci.math.symbolic)
  • Re: Tracing Program Memory Usage
    ... current size of virtual memory used by the process. ... The operating system ... Microsoft Online Community Support ... nature are best handled working with a dedicated Microsoft Support Engineer ...
    (microsoft.public.dotnet.languages.vb)