*** WARNING ***
Dangerously newbish questions follow.
These are followup questions to a thread that veered off into memory land
regarding the Palm Debugging Console.
Please feel free to refer me to documentation.
QUESTIONS
---------
1) The command "hd 1" yields a heap dump of heap 1. I'd like to know more
exactly what the titles along the top of the resulting display mean.
Each line represents a chunk. Are those *all* the chunks in this heap or
just the allocated ones? If so,
- start = starting address in memory of each chunk. What does the asterisk
mean?
- handle = the handle of the chunk if it's movable.
- localID = the localID of the chunk.
- req. size = size of the chunk I asked for.
- act. size = size of the chunk I got.
- lck = the current number of locks on the chunk. (Why are there locks on
chunks after I reset the device? Shouldn't all these chunks be available?
Although I suppose the OS is holding chunks locked...)
- own = ?????? (the owner of the chunk...but what does the number
represent? And how do I determine which owner is my application?)
- flags = ??????
- type = ?????
- index = ?????
- resType/attr ctg = ?????
- #resID/uniqueID name = ?????
Some of these latter fields are blank for many heaps.
At the end of the display:
Heap Summary:
flags: 8000 (What does this represent?)
size: 1E7EF2 (Total size of the heap?)
numHandles: #200 (Total number of handles...in use?
Available?)
Free Chunks: #12 (1E58FE bytes)
(Does this number represent the total amount of free memory in
the
heap? If there's a memory leak, is this where I should see memory
decrease over time?)
Movable Chunks: #51 (0022C4 bytes)
(These chunks are movable. Are they free? Or could they be in
use,
but still movable? What would an increasing/decreasing # mean?)
Non-Movable Chunks: #0 (000000 bytes)
(Same questions about this.)
Other Questions
---------------
1) Is it safe to run heap commands like hd or ht while my application is
running? I've found that this can make CodeWarrior unstable...am I doing
something incorrectly? What about while Gremlins are running? Or should I
do this before the app is loaded?
Also, using the console, then debugging, then recompiling with changes and
using the console again can render the whole IDE unstable. Am I missing
something here? If I close the console before re-compiling, it's usually
fine.
2) Do I have to mess with the settings of mdebug before using heap
commands? Why?
3) What is hchk actually checking? And are hchk's results based on
mdebug's settings?
4) Occasionally, I'll get a message that the heap is corrupted. For
example, if there's a FrmHandler in a loop that
creating/locking/unlocking/freeing handles and I issue "ht 0", I sometimes
get a "corrupted heap" message. I assume that this is because the hd is
issued at some inappropriate time in the loop relative to the state of
handles.
What is this "corrupted heap" message referring to? Under/overlocked
handles? Bad pointers? And how does it make this determination?
5) mdebug's primary function seems to be to make the IDE unstable. ;-) Is
this normal? mdebug -min seems like a useful thing to use, given that
we've been talking about the minimum space on the dynamic heap. But using
it can cause an "Unhandled Exception" error in the IDE, not unlike the
infamous error about Palmrez in CWR5 before the patch was issued. I must
be missing something.
Hope that someone besides me finds the answers useful.
Cheers,
--
Andrew Ball
[EMAIL PROTECTED]