In the middle of my MIDlet program I'm getting an "heap out of memory message" do you know what I could do to alleviate this situation. Ankur
Eric Giguere
Ranch Hand
Joined: Oct 25, 2000
Posts: 170
posted
0
Your app is using too much memory. You need to either (1) create less or smaller objects, or (2) free more objects. Most of the standard Java techniques for reducing the memory footprint of an application apply: instantiate objects lazily, help the garbage collector (null out unused references early and often), etc. Shameless plug: I discuss these kinds of things in both my J2ME books. But really, any good book on Java application optimization will also cover the material.
I have an interesting and similar problem. The same application runs fine on the Palm VIIx device and never craches. But on Handspring Visor Edge(which is a newer device and has much more memory than Palm VIIx), the application craches quite often. This leads me think that there are bugs either on the device or on the KVM. Can anybody give me some suggestion how to solve the application crashing problem on Handspring Visor/Edge device? Thanks. Liang