From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: border1.nntp.dca3.giganews.com!backlog3.nntp.dca3.giganews.com!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!goblin2!goblin.stu.neva.ru!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Increasing GNAT's heap Date: Wed, 13 Nov 2013 09:58:13 +0100 Organization: cbb software GmbH Message-ID: <1ogylkzganxtj.1fuy036v94ui4$.dlg@40tude.net> References: <1o29hesl8k6yk$.1kqputng2vdks$.dlg@40tude.net> <87habgiufi.fsf@ludovic-brenta.org> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: IenaDxMXK2hi7fvYcb+MlQ.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 X-Original-Bytes: 2566 Xref: number.nntp.dca.giganews.com comp.lang.ada:183849 Date: 2013-11-13T09:58:13+01:00 List-Id: On Wed, 13 Nov 2013 09:21:05 +0100, Ludovic Brenta wrote: > "Dmitry A. Kazakov" 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