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 autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,a41bdc9275138107,start X-Google-Attributes: gid103376,public From: NKSW39B@prodigy.com (Matthew Givens) Subject: Dynamic Allocation problem Date: 1997/04/04 Message-ID: <5i436p$248c@newssvr01-int.news.prodigy.com>#1/1 X-Deja-AN: 230787972 Distribution: world Organization: Prodigy Services Company 1-800-PRODIGY Newsgroups: comp.lang.ada Date: 1997-04-04T00:00:00+00:00 List-Id: Okay, I'm working on an Ada program that uses a LOT of dynamic allocation. The program is supposed to retrieve records from an ORACLE database and load them into a Listbox (I'm running on a Sun). It works fine for about 1600 records, then croaks on an attempt to dynamically allocate the new memory. The listbox data is stored (don't blame me, I didn't design it) in one large string, each row separated by LF's. Only 100 rows at a time are actually displayed, but all rows are stored in the string. Now, at the time of the crash, the listbox string takes up approx 300K, with the new row taking up 230 bytes. When I try to allocate the new memory (using new), it dies with a STORAGE_ERROR exception. Now, is there any way for me to check the amount of available storage BEFORE I actually try the allocation? It would be helpful to me in debugging if I could tell how close to the memory limit I am at any given point, but I don't know how to do this. Any help is appreciated. - "Outside of a dog, a book is a Man's best friend. Inside of a dog it's very dark." << Iceman >>