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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,419864ed91cc937d X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!feeder.news-service.com!85.214.198.2.MISMATCH!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Ludovic Brenta Newsgroups: comp.lang.ada Subject: Re: heap size exceeded for large matrices Date: Sun, 29 Aug 2010 23:29:59 +0200 Organization: A noiseless patient Spider Message-ID: <878w3pcdk8.fsf@ludovic-brenta.org> References: <14007b1b-c290-4c73-a0ec-d3c5195b83d4@t20g2000yqa.googlegroups.com> <4c7a360b$0$10227$ba4acef3@reader.news.orange.fr> <1dc06325-e39a-4cbc-9c54-c51921923bd7@g17g2000yqe.googlegroups.com> <4c7a9fa2$0$5423$ba4acef3@reader.news.orange.fr> <87fwxxcjlu.fsf@ludovic-brenta.org> <4c7ac40c$0$5388$ba4acef3@reader.news.orange.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Date: Sun, 29 Aug 2010 21:29:59 +0000 (UTC) Injection-Info: mx03.eternal-september.org; posting-host="MFOmPp7Dab5yIeESbQaxLg"; logging-data="2458"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19bG7IXyl9vUiObF2mUt4aa" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) Cancel-Lock: sha1:waknc/ypMUVl3hUIKZbNJorc568= sha1:XvmwZTb6FQzIPDt8ZXw/1V4OQMM= Xref: g2news1.google.com comp.lang.ada:13830 Date: 2010-08-29T23:29:59+02:00 List-Id: Robert A Duff writes: > Pascal Obry writes: > >> Ludovic, >> >>> Here is another guess: the large array was on the secondary stack, which >>> is taken from the heap? >> >> I don't think the secondary stack is taken from the heap... but I'm far >> from expert on this! > > It is taken from the heap (by chunks) on some (most?) platforms. > On others, it is allocated on the primary stack. > See package System.Parameters. This says that on x86_64-linux-gnu (which is both John's and my platform), the secondary stack is indeed on the heap. > As far as I know, the only things allocated on the seconary stack are > function results of caller-unknown size (as in function(...) return > String), and some controlled/finalization-related things. Right, that would be the case for a function returning the large array, which was of an unconstrained type (array (Positive range <>, Positive range <>) of Long_Float in this case). -- Ludovic Brenta.