[comp.sys.amiga.tech] Amiga Resource Status

joe@dayton.UUCP (Joseph P. Larson) (03/08/90)

I have a problem.  I have a set of programs that run on my Amiga.  On
shutdown, I don't appear to be releasing all my resources.  I've tried
to find the resources I'm hanging on to, but I'm not having luck.

Now, how do I know I'm hogging resources after quitting?  Well, the
before-count for "avail" is about 75K larger than the after-count.
Furthermore, if I restart my program, it crashes.

The worse part is, I thought I was checking return statuses on absolutely
everything.

So -- is there some way I can query the machine to see what resources
have been allocated by someone?  This might provide me some pointers
towards what I'm doing wrong.

If anyone else has some suggestions on what I might be doing, lemme know.
This is starting to get annoying.

Reply to me and I'll summarize on the net, if I get anything worth
summarizing.  Thanks. -joe
-- 
UUCP: rutgers!dayton!joe   (Picts 1-16 are   DHDSC - Joe Larson/MIS 1060
ATT : (612) 375-3537       now ready.)       700 on the Mall, Mpls, Mn. 55402

karl@sugar.hackercorp.com (Karl Lehenbauer) (03/08/90)

In article <7257@dayton.UUCP> joe@dayton.UUCP (Joseph P. Larson) writes:
>I have a problem.  I have a set of programs that run on my Amiga.  On
>shutdown, I don't appear to be releasing all my resources.  I've tried
>to find the resources I'm hanging on to, but I'm not having luck.

You can try to use my routines that track C AllocMem and FreeMem calls.
They are quite comprehensive and, when compiled with your program, will 
report the file name and line number and amount of memory allocated for every
allocation that isn't correspondingly freed, plus report relevant files and
line numbers for memory is freed twice, memory freed when not allocated, or
memory freed of an amount different than what was allocated.

They're on Fred Fish disk something-or-other.  Or email me and I'll send
you the latest copy, I guess.
-- 
-- uunet!sugar!karl	"As long as there is a legion of superheros, all else
--			 can surely be made right." -- Sensor Girl
-- Usenet access: (713) 438-5018

davidw@telxon.UUCP (David Wright) (03/08/90)

	Everyone seems to be overlooking a resource tracking system that
has been available for quite a while. ARP provides automatic tracking
and freeing of memory, libraries, windows, etc. I have used this extensively,
and found that the memory routines to be the most usefull, so that I can just
request the memory I need, and not bother to free it at all. The arp exit
routine handles all of that for me. If you are doing something that requires
you to free it or reallocate it's size later, you do have to keep one
additional variable for every item you want to free, so there is a little
more work than in Unix, but as most applications simply want to allocate
memory on the fly, or at run-time, the default handling works great.

			Dave