I don't think there's a lot of difference. Allocating memory is a relatively expensive opreation, so if performance is an issue (more so than memory usage), you might consider allocating the maximum amount of memory at the beginning of your app / procedure.
But in your case it doesn't really matter, I think. You mentioned a 'big' record of 3K. Is this an 'upper boundary'? You'll have no problems allocating 3K and sizing it down - if necessary - afterwards. On the other hand, you also talked about 150 objects as some kind of upper limit. If you allocate chunks for 50 objects, that would be 3 allocations. I don't think you have to worry about this seriously slowing your app down. So I'd say: just do whatever feels best / most intuitive / makes for the most readable code. Hope this helps, Caspar -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Mitch Sent: Thursday, October 16, 2003 9:47 PM To: Palm Developer Forum Subject: Design Input Please I have an application that generates a single database record during the course of being used for 4-6 hours (in addition to a bunch of other stuff). The record is a list of data objects (each about 36 bytes). Depending on the user, the record may get to be as big as 150 or so objects. But it might only be 40-80, with no real way to predict in advance. My question is should I allocate one "big" record (in the datamanager) that is 3K or so and then resize the record down when I close it or allocate in "chunks" (40 or 50 objects large) as I go. Or, is this still small enough that it doesn't really make any difference? Thanks, Mitch -- 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/
