Ravi: There are three, logically separate, convenient sources of memory for a program on a PalmOS device: The stack (function locals), the dynamic heap (MemPtrNew and MemHandleNew), and the storage heap (DmNewRecord, DmNewHandle). The stack and dynamic heap are small, particularly on older OS variants and devices. Access to the storage heap is restricted (you must use DmWrite and its brethren) and thus somewhat slower.
These constraints mean that you must be very careful in algorithm design. Simply allocating from the dynamic heap a large buffer to use throughout your algorithm (or many smaller ones that pile up) can rapidly run you into trouble with large data sets. If you must handle large data sets on small devices (those pesky front-office types always seem to want it all ;)), grab memory in smaller chunks and then return it promptly when you are done with it -- i.e., convert one (or a very few) records, write out the converted form, toss the old records, repeat. But if you just cannot get around needing to use lots of memory at once, you will be forced to use it from the storage heap and pay the performance (and code complexity) penalty. Hope this helps, -bob mckenzie, palmsource pdx p.s. The section on Memory in the Palm OS Companion doc is a good read. -----Original Message----- From: ravikumar Amaravadi [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 05, 2002 9:42 PM To: Palm Developer Forum Subject: Memory Manager NULL Handle Error Dear Sir, We are developing an application to Encrypt the contents of MemoDB and rewrite the cipher contents back...In the process, when MemoDB size is of 8 KB with 10 records, we are able to encrypt and maintain the ciphers in the Database. But when we are decrypting the ciphers back, we are running out of Dynamic memory space with the error showing "Memory Mgr.c NULL Handle"...How do we cope up with this problem of memory management ? Our application size is of 67 KB and the PalmOS ver is 3.2 and RAM is of 2 MB... Regards, Ravi Kumar A __________________________________________________ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com -- 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/
