Hi,
my machine has 4 GB of RAM and I am wondering, why I can't use
at least 2 or 3 GBytes to run an Ada program. It seems, that my
Ada Compiler (Gnat 4.4.0) limit the memory to 2 GB per default.
Is it possible to allocate more than 2 GB?
Here is a simple example of an "evil" vector, that gains
more memory in each pass. The program terminates exactly at
1024 MB of used Heap memory.
with Ada.Containers.Vectors;
procedure Heap is
package Generic_Vector is new Ada.Containers.Vectors
(Element_Type => Integer, Index_Type => Natural);
Evil_Vector : Generic_Vector.Vector;
begin -- Heap
loop
Generic_Vector.Append (Evil_Vector, Integer'Last);
end loop;
end Heap;
heap(6374) malloc: *** mmap(size=2147487744) failed (error code=12)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
raised STORAGE_ERROR : heap exhausted
I could not find a suitable Compiler switch or a parameter, that
can be set for the operating system (linux). "ulimit -v" is already
set to unlimited.
"gnatmem" re****ts, that my water mark with 1024 MB is reached, but
the final water mark is, needless to say, higher.
Best regards,
Dennis Hoppe


|