I would say simply deleting everything is definitely not sufficient. There
are two kind of problems: first, there are bugs in in PalmOS which leave
memory leaks (Roger must have had bad day when writing CtlNewControl) and
second, you have another problem due to memory fragmentation. I haven't
looked very deep into the memory manger yet, but what I saw was that if you
create and the correctly release a dynamic form the amount of your free
memory might not change (if you have modified some functions to avoid
leaks), but the size of your largest chunk will decrease. I explain this
with the memory manager implementation, but as I said I still don't know if
I am right...well...we'll see ;-)

Hope this helps a bit,
Bobby

-----Original Message-----
From: Schettino, John [mailto:[EMAIL PROTECTED]]
Sent: Friday, August 04, 2000 1:54 PM
To: Palm Developer Forum
Subject: RE: Freeing memory after dynamically creating form objects


Looking at the PalmOS source code, it does free "dynamic" UI elements. Other
than field memory, all memory in a form exists within one allocated handle.
When you add elements, that handle is resized. When you delete the form, the
single handle is freed (after any field memory is freed.)

OS Source -- a wonderful thing ;)

- John Schettino
Palm OS Programming for Dummies: http://schettino.tripod.com

-----Original Message-----
From: Magn�s ��r Torfason [mailto:[EMAIL PROTECTED]]
Sent: Friday, August 04, 2000 4:16 AM
To: Palm Developer Forum
Subject: Freeing memory after dynamically creating form objects



Hi,

I am working on a Palm project making extensive use of dynamic components. I
am wondering if it is sufficient to use FrmDeleteForm to release any memory
occupied by dynamically created form objects (controls and fields) orwhether
I need some special consideration in doing so e.g. using FrmRemoveObject
etc.

I know from the Reference that FrmDeleteForm releases all resources for
components created with Constructor, so the question is specific to
DYNAMICALLY allocated components on form.  On this matter the Reference was
not as clear (as usual, when dealing with dynamic stuff :)

Regards,

Magnus Torfason


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

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

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

Reply via email to