> From: Zhang Juan
> Sent: Friday, July 18, 2003 12:31 PM
> 
> Hello. Can anybody help me please
> 
> I met a mistake when I debug my programme:
> 
> Found 1 memory leak for ***... Information concerning the 
> leak can be found in the log file.
> 
> Where Can I found the log  file. And why memory leak happened..

The log files generated by Palm OS Emulator (POSE) end up in the same
directory as the POSE executable.  For example, when I run POSE, this
file is being executed:

C:\Program Files\CodeWarrior 9.1\CW for Palm OS Tools\Palm OS
Emulator\Emulator.exe

In the same directory as Emulator.exe, you will find numbered
"Log_XXXX.txt", the most recent of which corresponds to the most
recently-reported memory leak.

Analyze the logfile to determine in what function the leaked memory was
allocated.  This is determined by looking at the stack trace:

0.000:  Non-relocatable chunk leaked at 0x00039C34, size = 9
0.000:  Chunk allocated by:
0.000:          SetControlLabel
0.000:          MainViewInit
0.000:          MainViewHandleEvent
0.000:          PrvSendEventToForm
0.000:          FrmDispatchEvent
0.000:          AppEventLoop
0.000:          StarterPalmMain
0.000:          PilotMain
0.000:          __Startup__
0.000:  Chunk contents:
0.000:          50 61 6C 6D 43 61 72 64  00
PalmCard

In this logfile, it's telling me that I leaked 9 bytes in my
SetControlLabel() function, and the actual leaked memory happens to
contain the bytes to the string "PalmCard".  It's pretty obvious from
this that the control's label is not being deallocated before it's set
to something else.

Hope this helps,
-Jeff Ishaq



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to