comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Increasing GNAT's heap
Date: Wed, 13 Nov 2013 09:58:13 +0100
Date: 2013-11-13T09:58:13+01:00	[thread overview]
Message-ID: <1ogylkzganxtj.1fuy036v94ui4$.dlg@40tude.net> (raw)
In-Reply-To: 87habgiufi.fsf@ludovic-brenta.org

On Wed, 13 Nov 2013 09:21:05 +0100, Ludovic Brenta wrote:

> "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> writes:
>> Does anybody know a way to increase the heap size available for GNAT? It
>> crashes with famous GNAT BUG DETECTED, Storage_Error heap exhausted.
>>
>> GNAT 4.6.4 under Debian, testing, 32-bit
> 
> Presuming the heap is really exhausted (i.e. the command "free" shows no
> free physical RAM and no free swap space left, and the command "top"
> shows the gnat1 process consuming close to 4 GiB of resident memory)
> then I'd suggest that you cannot increase the heap.  So, you should
> compile smaller source files.

It is 8GB RAM allowed for the virtual machine.

Are you sure about 4GB? Doesn't Linux reserve some address space for its
the kernel? Under Windows, where GNAT has same problems I cannot get more
than 2GB. There is a boot switch to allow 3GB but it does not work well
with GNAT. When GNAT is running under 64-bit Windows it goes through being
32-bit itself. From this I conclude that true 4GB under Linux would be
enough to compile it.

> I'd try to identify which subprogram causes the problem and place that
> subprogram in a compilation unit of its own (e.g. a private child unit).

It is always generic instances in the case of GNAT. It appears that the
GNAT compilation model is not very much separate compilation. A compiled
generic package instance does not reduce the amount of memory required
later at the point when another body with/use it. The compiler starts
frantically allocating huge amounts of memory, expanding generics, I
suppose. This is how it comes to gigabytes when compiling a mere 100-liner.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de


  parent reply	other threads:[~2013-11-13  8:58 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-12 11:09 Increasing GNAT's heap Dmitry A. Kazakov
2013-11-12 13:26 ` Georg Bauhaus
2013-11-12 14:00   ` Dmitry A. Kazakov
2013-11-12 17:31     ` Paul Rubin
2013-11-13  8:00       ` Dmitry A. Kazakov
2013-11-12 19:30     ` Georg Bauhaus
2013-11-12 22:03 ` Florian Weimer
2013-11-13  8:05   ` Dmitry A. Kazakov
2013-11-13 15:41     ` Oliver Kleinke
2013-11-13  8:21 ` Ludovic Brenta
2013-11-13  8:23   ` Ludovic Brenta
2013-11-13  8:58   ` Dmitry A. Kazakov [this message]
2013-11-13 11:04     ` Georg Bauhaus
2013-11-13 13:31       ` Dmitry A. Kazakov
2013-11-13 15:39         ` Oliver Kleinke
2013-11-13 16:07           ` Eryndlia Mavourneen
2013-11-13 16:11             ` Eryndlia Mavourneen
2013-11-13 17:27           ` Dmitry A. Kazakov
2013-11-13 17:41             ` Eryndlia Mavourneen
2013-11-13 18:02               ` Dmitry A. Kazakov
2013-11-13 15:37       ` Oliver Kleinke
2013-11-13 15:32     ` Oliver Kleinke
2013-11-13 17:36       ` Dmitry A. Kazakov
2013-11-13 18:44         ` Oliver Kleinke
2013-11-13 22:08     ` Ludovic Brenta
2013-11-14  8:51       ` Dmitry A. Kazakov
2013-11-14 10:50         ` Georg Bauhaus
2013-11-14 11:16           ` Dmitry A. Kazakov
2013-11-14 13:07 ` Marius Amado-Alves
replies disabled

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