Thanks Danny, the leak goes away when I do FrmCloseAllForms before exit.
So am I actually leaking memory if I don't do the FrmCloseAllForms?
Jacky
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Danny
Epstein
Sent: Friday, February 16, 2001 10:19 AM
To: Palm Developer Forum
Subject: Re: Memory leak
First of all, be sure to call FrmCloseAllForms before your app exits from a
normal or goto launch.
I've found that using MemHeapFreeBytes isn't a very good way to detect
leaks. The system uses dynamic heap space for various purposes, and that'll
appear as if it's a leak. For example, the clipboard is stored in the
dynamic heap. If you're using a modern debug ROM, the system will do a
better job at detecting leaks. You can then use debugger console commands to
see how many chunks were leaked, how big they are, and what they contain. If
this isn't enough to pin-point the leak, you can wrap MemPtrNew, etc with
your own routines that track the chunks you're using. This lets you see
exactly where you allocated each leaked chunk with error messages like this:
A 36 byte chunk was allocated in Foo.c, line 100, and was never freed.
The tricky bit is dealing with routines that aren't primarily involved with
memory management, but can affect the dynamic heap. For example, fields can
resize the chunk containing the text being edited.
--
Danny Epstein
OS Engineer, Palm Inc.
--
For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/tech/support/forums/
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/