如何在Java ME中增加堆大小?

时间:2020-12-29 17:20:21

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.

有没有办法在设备上增加Java ME的堆大小?我正在为诺基亚N95开发一个应用程序,但是当我尝试对更大的图像进行图像处理时会遇到内存问题。手机有足够的堆空间,但似乎限制了Java ME允许使用的数量为1MB。

2 个解决方案

#1


5  

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...

更长的答案:堆大小在设备VM中是硬编码的。如果内存不足,则需要将任务拆分为更小的子任务以允许GC启动。内存有限,只能进行有限的操作。你想......

#2


0  

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.

在一些J2ME手机上设置Midlet-Heap-Size jad属性。说一个手机只有2MB堆,设置这个jad属性就说3MB增加堆到3MB。你可以尝试一下,但它对我来说很少用手机。

#1


5  

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...

更长的答案:堆大小在设备VM中是硬编码的。如果内存不足,则需要将任务拆分为更小的子任务以允许GC启动。内存有限,只能进行有限的操作。你想......

#2


0  

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.

在一些J2ME手机上设置Midlet-Heap-Size jad属性。说一个手机只有2MB堆,设置这个jad属性就说3MB增加堆到3MB。你可以尝试一下,但它对我来说很少用手机。