It's even worse on the PocketPC. If you ask for ram there's no room for,
rather than returning NULL, the O/S goes away to compact memory, fails every
time, and locks up your machine. This is real handy given the often very
tight restrictions on memory we're already used to.

I solved it by writing my own memory allocator working from one big chunk
allocated by the O/S at program startup. It's actually very simple once you
get your head around it and will solve a lot of headaches like this.

Would this be a feasible fix ?


Regards,
Paul Johnson
Applewood House
www.applewoodhouse.com
----- Original Message -----
From: "Jan Slodicka" <[EMAIL PROTECTED]>
To: "Palm Developer Forum" <[EMAIL PROTECTED]>
Sent: Monday, June 23, 2003 1:51 PM
Subject: Palm OS bugs in low memory conditions?


> Hello
>
> I started to test our app under various stress conditions.
>
> When running on extremally low storage memory (we rely on that memory
> heavily) I found several examples of crashes that I believe can be
> attributed to the Palm OS.
>
> The most clear proof represent following consecutive lines:
>
> stdDib = MemPtrNew( sizeof( StdDib) );
> if( stdDib != NULL )
>     MemSet( stdDib, sizeof( StdDib ), 0 );
>
> The emulator claims the pointer passed to MemSet is an unallocated chunk
of
> memory. That chunk really points to a block that was in this sequence
> allocated (and later released) a little bit earlier.
>
> Another time MenuHandleEvent() crashed (also on memory problem) without
app
> code being involved at all.
> Or again inside FrmCustomAlert(). (In PrvChunkNew().)
>
> The above problems appeared on Emulator 3.5 running on m515 release rom,
but
> they seem to appear on real devices, too. (Although I did not come that
> close yet.)
>
> Does anyone know how to prevent such situations?
>
> Jan Slodicka
>
>
>
> --
> 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