How to Increase heap size in Java ME?

天涯浪子 提交于 2019-12-22 10:48:25

问题


Is there any way to increase the heap size for Java ME on a device? I'm developing an application for a Nokia N95, but am bumping into memory issues when I try to do image processing of larger images. The phone has plenty of heap space available, but seems to restrict the amount allowed to be used by Java ME to 1MB.


回答1:


Short answer: No.

Longer answer: Heap-size is hardcoded in device VM. If you are running out of memory you need to split you task into more smaller sub tasks to allow GC to kick in. With limited memory only limited operations are possible. You figure...




回答2:


On some J2ME handsets setting Midlet-Heap-Size jad attributes works. Say a handset has only 2MB heap, setting this jad attribute to say 3MB increases the Heap to 3MB. You can try this out, it worked on very few handsets for me though.



来源:https://stackoverflow.com/questions/348018/how-to-increase-heap-size-in-java-me

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!