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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,5de108d9cf7f21e0 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-09-20 05:22:57 PST Path: archiver1.google.com!news2.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!hammer.uoregon.edu!skates!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: Question concerning usage of gnatmem Date: 20 Sep 2002 08:07:46 -0400 Organization: NASA Goddard Space Flight Center (skates.gsfc.nasa.gov) Message-ID: References: NNTP-Posting-Host: anarres.gsfc.nasa.gov Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: skates.gsfc.nasa.gov 1032524286 26021 128.183.220.71 (20 Sep 2002 12:18:06 GMT) X-Complaints-To: usenet@news.gsfc.nasa.gov NNTP-Posting-Date: 20 Sep 2002 12:18:06 GMT User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: archiver1.google.com comp.lang.ada:29212 Date: 2002-09-20T12:18:06+00:00 List-Id: "Dr. Michael Paus" writes: > Stephen Leake wrote: > > "Dr. Michael Paus" writes: > > > >>When I run the program I have to stop it via Cntrl-C because this software > >>was designed to run forever and there is no other way to stop it. Does this > >>lead to a corrupt output file? > > In general, I suspect the answer is "yes". > > > >>If the output is likely to be corrupt is there any other way to get > >>the memory usage until the time when the program is stopped? > > Probably not. Modify your code; it probably has a top-level forever > > loop. Change it > > to run 1000 times, or whatever produces useful results. > > Well, if it were so easy I would have done that already :-) The program > consists of about 30 tasks all waiting for some input to process and > some of them listening on sockets to receive some data from external > sources. It is not so easy to force this program to terminate without > major changes to the code. As I recall, what you are doing is trying to find out if there is a memory leak. That can be done by running each piece of the program separately, in a unit test. If each unit does not leak, the program as a whole does not leak. Hmm, maybe you were trying to find out the max memory usage of the program. That's harder to do in pieces, since it depends on the pattern of use. If you really need to know that, you'll need to define your own storage pools, that allow you to query their current usage. Then add a command to one of the tasks to dump that information. > If I remember correctly there was a discussion here recently on how > to stop an Ada program. The solution, if there was any, would be > handy here now. Abort the environment task. That's supposed to also abort all dependent tasks, but it may not work if they are waiting on sockets (since that's an OS issue, not an Ada issue). Give it a try. Perhaps you can add a "please terminate" message to each task? Maybe that's what you meant by "major changes to the code". -- -- Stephe