How to increase heap size in Java ME?

Is there a way to increase the heap size for Java ME on the device? I am developing an application for Nokia N95, but I am in memory problems when I try to process images of large images. A large amount of heap is available on the phone, but, apparently, it limits the amount allowed for using Java ME to 1 MB.

+3
source share
2 answers

Short answer: None.

Longer answer: the heap size is hardcoded in the device virtual machine. If you run out of memory, you need to split the task into smaller subtasks to allow the GC to enter. Limited memory is limited. You see...

+5
source

On some J2ME models, Midlet-Heap-Size jad attributes are configured. Suppose the phone has only 2 MB of heap by setting this jad attribute to say that 3 MB increases the heap to 3 MB. You can try it, but for me it worked on very few phones.

0
source

All Articles