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.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no 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 Path: g2news1.google.com!postnews.google.com!l20g2000yqm.googlegroups.com!not-for-mail From: John Raymond Dore Newsgroups: comp.lang.ada Subject: Re: heap size exceeded for large matrices Date: Sun, 29 Aug 2010 09:16:53 -0700 (PDT) Organization: http://groups.google.com Message-ID: <340c87af-1f15-4590-baa9-ec7e864b7048@l20g2000yqm.googlegroups.com> References: <14007b1b-c290-4c73-a0ec-d3c5195b83d4@t20g2000yqa.googlegroups.com> <4c7a360b$0$10227$ba4acef3@reader.news.orange.fr> NNTP-Posting-Host: 87.127.167.40 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1283098613 18279 127.0.0.1 (29 Aug 2010 16:16:53 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sun, 29 Aug 2010 16:16:53 +0000 (UTC) Cc: =?ISO-8859-1?Q?John_Raymond_Dor=E9?= Complaints-To: groups-abuse@google.com Injection-Info: l20g2000yqm.googlegroups.com; posting-host=87.127.167.40; posting-account=pboFsQoAAADH8TYX41qFyLv6hZJulZoo User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-GB; rv:1.9.2.7) Gecko/20100716 Ubuntu/10.04 (lucid) Firefox/3.6.7,gzip(gfe) Xref: g2news1.google.com comp.lang.ada:13820 Date: 2010-08-29T09:16:53-07:00 List-Id: On Aug 29, 4:14=A0pm, Brian Drummond wrote: > On Sun, 29 Aug 2010 12:27:37 +0200, Pascal Obry wrote: > >John, > > >> I wish to process both real and complex large matrices eg (1..10000, > >> 1..10000) > >> I have no difficulty in increasing the storage size of a task. > >> I cannot do the same for matrices within a procedure which reports > >> that the heap is exceeded. > > >You probably mean stack size and not heap size. In that case you need to > >add the proper linker option to increase the stack size for the applicat= ion. > > >Pascal. > > I have had trouble with this in the past - the documented linker options > apparently didn't work (around the 2008 timeframe - may not still be true= ) and > Pragma Storage_Size only worked for new tasks, not the main program.. > > I resorted to dynamic allocation on the heap, and renaming to hide the po= inter > dereference. So, given > my_array_type is array (positive range <>, positive range <>) of float; > > I replaced > > my_array: my_array_type (1..10000, =A01..10000); > > with > > my_array_ptr : access my_array_type :=3D new my_array_type (1..10000, =A0= 1..10000); > my_array : my_array_type renames my_array_ptr.all; > > The rename meant I didn't have to rewrite anything else in the applicatio= n. > > - Brian Brilliant elegant solution to my problem Brian. It works just fine. Very many thanks. John