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.