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.3 required=5.0 tests=BAYES_00,INVALID_MSGID, MSGID_RANDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,dc393c3a10696107 X-Google-Attributes: gid103376,public From: Achim Gerhard Subject: Re: Create-Delete tmp Files Date: 2000/03/21 Message-ID: <8b8195$ahk$1@nnrp1.deja.com>#1/1 X-Deja-AN: 600403500 References: <8b4n77$u4a$1@nnrp1.deja.com> X-Http-Proxy: 1.0 x33.deja.com:80 (Squid/1.1.22) for client 195.243.118.226 Organization: Deja.com - Before you buy. X-Article-Creation-Date: Tue Mar 21 14:34:13 2000 GMT X-MyDeja-Info: XMYDJUIDachim_g Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.7 [en] (WinNT; I) Date: 2000-03-21T00:00:00+00:00 List-Id: In article , tmoran@bix.com wrote: > >loop > >Text_IO.Create ( File => the_file, Mode => Text_IO.OUT_File ); > >Text_IO.Reset ( File => the_file, Mode => Text_IO.IN_File ); > >Text_IO.Delete ( File => the_file ); > >end loop; > >Why does this code cause the Ada runtime to accumulate memory? > >For me, at this time, it doesn't matter what compiler and machine. > For me, using Janus 3.1.1e for Windows NT and using the vendor's > library Memavail and Maxavail routines, and the Windows 95 System > Monitor accessory, 10,000 times around the loop shows no memory loss. > Sounds like an error in your compilers or OSes. OK. But it seems to be a common error. You can see this behaviour with Alsys Ada v5.5.2 and v6.2.1; Solaris 2.5; Sparc VADSself Ada 6.2; Solaris 2.5; Sparc Alsys Ada V5.5.8; LynxOS 2.3; x86 ObjectAda 7.1.2; MS-Windows NT; x86 GNAT 3.12p; MS-Windows NT; x86 (all for now) I wrote 'it doesn't matter what compiler and machine', because my question was (in 'other' words): "Should the following work?" loop Text_IO.Create ( File => the_file, Mode => Text_IO.OUT_File ); ... some statements to write to the_file ... Text_IO.Reset ( File => the_file, Mode => Text_IO.IN_File ); ... some statements to read from the_file ... Text_IO.Delete ( File => the_file ); -- at this point all stuff concerning the_file has disappeared -- and the heap (and everything else) looks as if the_file -- has never been created end loop; Something is wrong. Is it my Ada code or is it the Ada runtime? Regards, Achim -- _ _ /A/G Sent via Deja.com http://www.deja.com/ Before you buy.