Memory management on "real-world" J2ME devices
Hi J2ME Community,
At Playscape Games we are developing a J2ME game 'Arcadia' that, as it
nears completion, is increasingly bumping against out target minimum
heap memory size of 800K.
I am considering strategies for memory optimisation & reclaimation, and
would appreciate any advice or opinions from the community on several
distinct memory related issues, with respect to modern real-world
handset J2ME implementations:
1. Memory Fragmentation:
Do/which current generation handset suffer memory fragmenetation (ie do
not use a compacting garbage collection algorithm)? One clear way to
reduce memory is to unload sprites that are not being rendered. This
will not work well with heap that fragment, however.
2. Unreclaimable memory
I have heard talk of handsets where Images (and perhaps other UI object
like Fonts, Canvases, etc) are stored in separate memory regions and are
not garbage collected, ever. What handsets, if any, have such
3. Reducing memory impact of Record Store access at Load/Save time
The Record Store API reads/writes data as byte blocks, rather than
streams. Our current load/save implementation therefore naively
read/writes the entire level data into a single byte array, then
parses/writes it respectively. We observe in a spike in memory
consumption at load/save time, well above the general memory
requirements during play. The spike forces us to keep approx. the last
100K of heap aside, unused, to just serve for a second while the game is
saved. We are seeking a way to reduce the memory overhead incurred when
saving level, by using a stream or small bufffer that is regularly
flushed to the Record Store.
Have other J2ME game developers had memory issues at Load/Save time?
Does anyone have an effective strategy for optimizing heap use when
working with Record Stores?
To unsubscribe, send email to email@example.com and include in the body
of the message "signoff KVM-INTEREST". For general help, send email to
firstname.lastname@example.org and include in the body of the message "help".