At 09:52 AM 4/20/2005, you wrote:
Ok, I have 2 questions on MemHeapCompact.

1- The white paper says not to call it if there are openned databases. But
the docs says that the OS might call it if needed. Is it a possible source
of problem or is that OS feature desabled on NVFS devices ??

2- MemHeapCompact(MemHeapID(0,1)); can't call
MemHeapCompact(MemHeapID(0,1));
but can I call MemHeapCompact(MemHeapID(0,0));

Maybe someone can remind me the usage of heap 0 and heap 1 ??
I think that 0 is dynamic merory (new, alloc,...)
and 1 is storage memory (dm calls)
Right?

Heap 0 is the dynamic heap, heap 1 is the storage heap, at least on Palm OS 3.0 and later. Palm OS 1.0 and 2.0 divided the storage heap into 64K sections, but that's history now.


I asked about MemHeapCompact last week. The answer I got back from the PalmSource engineer was that on OS 5 devices, you should never call it for the storage heap. The code sets up a timer, and it stops compacting after 1/10th of a second, so if you've got any real level of fragmentation, it's likely that MemHeapCompact won't help you very much. If they didn't do this, the uncompact code is likely to make the device unresponsive for mulitple seconds. The only time the storage heap is really compacted is at reset time.


-- Ben Combee, Senior Software Engineer, palmOne, Inc. "Combee on Palm OS" weblog: http://palmos.combee.net/ Developer Forum Archives: http://news.palmos.com/read/all_forums/


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

Reply via email to