My program contains about 95% of its data as read only data 
structures.  The first thing it does when it starts is to lock down 
all its records (and hold them) so that it can set up static pointers 
to all the data. These records are as sequential as the PRC itself, 
since they are records of the PRC.  When the program exits, it 
unlocks all the handles.

Under SOME OS-5 devices, more often on Palms than CLIEs, the person 
finds that AFTER exciting our app, the entire devices has slowed to a 
crawl.  Nothing changes until a soft reset is performed.

I had suspected the cause might be something like you have discussed 
below, but if so, why would it persist AFTER my program exits and 
unlocks everything?

Thanks for the ideas...
- Jeff

--- In [EMAIL PROTECTED], Ben Combee <[EMAIL PROTECTED]> 
wrote:
> At 01:55 PM 7/25/2003, Laurens wrote:
> >>Also, non-movable chunks aren't as bad in Palm OS 3 and higher as 
they 
> >>were before, and on current OS 5 devices, the heap space is large 
enough 
> >>to allow a bit more flexibility.  Also, allocating a handle and 
then 
> >>leaving it locked for its entire life is considered worse than 
just 
> >>allocating a pointer directly, as the OS expects that handles 
will 
> >>generally be unlocked and movable.
> >
> >Is there any info on how and where the memory manager allocates 
> >chunks?   What algorithms are used for optimizing memory usage?
> 
> The Palm OS Companion has the best details.  On Palm OS 3 and 
later, there 
> is one large storage heap and a smaller dynamic heap.  The storage 
heap is 
> strictly handle-based storage, so it's not that interesting.  The 
dynamic 
> heap allows both handles and always locked chunks (MemPtrNew).  In 
general, 
> allocations for each type are biased towards one end of the heap or 
the 
> other, so MemPtrNew allocations are clustered near each other while 
> MemHandleNew allocations are arranged at the other end of the 
heap.  This 
> is why a locked handle can be dangerous, as it prevents efficient 
> rearrangement of that end of the heap.  The MemPtrNew'd chunks can 
cause 
> fragmentation for each other, but it takes a fair number of them to 
reach 
> into the active handle allocation region.
> 

> -- 
> For information on using the Palm Developer Forums, or to 
unsubscribe, please see http://www.palmos.com/dev/support/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