如何增加 Java ME 中的堆大小?
有没有办法增加设备上 Java ME 的堆大小? 我正在为诺基亚 N95 开发一个应用程序,但当我尝试对较大图像进行图像处理时遇到内存问题。 手机有足够的可用堆空间,但似乎将 Java ME 允许使用的空间限制为 1MB。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
简短的回答:否。
较长的回答:堆大小是硬编码在设备虚拟机中的。 如果内存不足,您需要将任务拆分为更小的子任务,以允许 GC 启动。内存有限,只能执行有限的操作。 你算...
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...
在某些 J2ME 手机上,设置 Midlet-Heap-Size jad 属性有效。 假设手机只有 2MB 堆,将此 jad 属性设置为 3MB 会将堆增加到 3MB。 你可以尝试一下,但它对我来说只适用于很少的手机。
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.