At 4:01 PM -0700 5/21/99, Jason Dawes wrote:
>70 * 2000 = 140,000.  Somehow I think that the Palm is going to have a
>little trouble allocating 136K of memory when it only has 96K total.  You
>need to use a database.

Or at least use storage heap space.  You can call DmNewHandle to get a
chunk of memory in the storage heap that is not associated with any
database.

If these strings really are temporary, that may be what you want.  Of
course, you'll still be restricted to the per-chunk limit of a bit less
than 64K... and if you're smart, you'll make sure you can use smaller
chunks so your allocator can still work when memory is nearly full or very
fragmented.

I'd suggest avoiding 1 record per string.  Each record in a record database
uses around 20 bytes of pure overhead, so with 2000 records that's 40K just
for the management.

DmNewHandle chunks require only 12 bytes of overhead each -- the same
amount as is required for a handle allocated from the dynamic heap.  So
play with the strings-per-chunk value to tune it for space overhead vs time
overhead.

On the other hand, if your strings aren't really temporary, you might be a
lot better off making them resources as part of a companion database for
your app...

                                --Bob


Reply via email to