I'm in a memory crunch.  I need to grab a lot of memory from the dynamic heap 
(~33.5K), but after calling NetLibOpen / NetLibSocketOpen / NetLibSocketClose / 
NetLibClose the heap is fragmented and I can't get what I need.  I've doublechecked 
that NetLibClose is receiving true for the 'immediate' argument and is returning 0 
(success, library closed).  The heap does NOT unfragment after I leave my app and come 
back in.

Using MemHeapFreeBytes I've found the following values for a certain session:
Pre NetLib: 58630 bytes free, 53014 chunk bytes available.
Post NetLibOpen: 29954 bytes free (NetLibOpen used 28676 bytes)
Post NetLibSocketOpen: 29488 bytes free (NetLibSocketOpen used 466 bytes)
Post NetLibSocketClose: 29700 bytes free (NetLibSocketClose freed 212 bytes)
Post NetLibClose: 58628 bytes free, 31796 chunk bytes available (NetLibSocketClose 
freed 28928 bytes)

NetLibSocketOpen & NetLibSocketClose always use/free the same number of bytes (466 & 
212), but NetLibOpen & NetLibClose do not.  I've placed MemHeapFreeBytes around the 
calls and they are the only functions in the 4 call sequence that touch the heap.

After the first call to the 4 functions, the bytes free at the beginning (before 
NetLibOpen) do NOT equal the bytes free at the end (after NetLibClose).  After 
subsequent calls to the 4 functions, the bytes free at the beginning (before 
NetLibOpen) DO equal the bytes free at the end (after NetLibClose).

POSER does NOT suffer fragmentation when used in the exact same way (using the serial 
line, NOT the NetLib Redirect).

Has anyone else noticed this problem?  The NetLib sources don't seem to be in the 3.0 
sources released by Palm.

Thanks

trib
--------------------------------------------------
David Tribble, INRI Hawaii
(808) 625 2118 (v)  (808) 625 6315 (f)

Reply via email to