For small allocations of 5 to 10 bytes, it's probably better just to declare
them as automatic variables rather than constantly allocating and deleting
them.  Use dynamic allocation for large blocks of memory and for variables
with a long life, although there has been some discussion as to what a long
life is.


--
Michael Yam
www.ytechnology.com
[EMAIL PROTECTED]


Jeff Ishaq <[EMAIL PROTECTED]> wrote in message news:8059@palm-dev-forum...
>
> Hey folks.  We're battling with dynamic heap fragmentation, and I'd
> appreciate any advice.
>
> Does anyone have any tips or tricks to reduce dynamic heap fragmentation?
I
> was thinking of pulling all of my string allocations out of a common pool
of
> memory, instead of little 5 and 10-byte MemPtrNew()'s everywhere.  But I'm
> not sure if that would be any better than simply calling MemHeapCompact()
> from time to time.  I'm not sure how thorough MemHeapCompact() is.
>
> Are there any rules of thumb I should follow for minimizing fragmentation?
> For example, lock a chunk for as little time as possible.  Pass handles
> around, not locked handle pointers.  What else?
>
> Does the background Netlib thread do any churning that can cause
> fragmentation when I don't expect it?
>
> Any help is appreciated.
>
> Have a good one,
> -Jeff Ishaq
> Vanteon, formerly The Windward Group
>
>
>



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palm.com/devzone/mailinglists.html

Reply via email to