Hi,
I've a JME application running in a samsung i617 cell phone, and the applications is throwing OutOfMemoryError when its heap goes over 7.1 MB (and the cell phone has 64 mb)...
Is it possible to use the -Xmx and -Xms parameters in JME
Hi,
I've a JME application running in a samsung i617 cell phone, and the applications is throwing OutOfMemoryError when its heap goes over 7.1 MB (and the cell phone has 64 mb)...
Is it possible to use the -Xmx and -Xms parameters in JME
No, this isn't possible. Max heap size is device dependent. See also this question.
The total memory of the handset is irrelevant. The JVM (or better the KVM) has only access to a part of it. The total amount varies from handset to handset. It could also be a restriction for the total memory a single MIDlet can access.
Try using WeakReference
s and WeakHashMap
s (e.g. on cacheable objects) to use as much memory as you can without throwing OutOfMemoryError. It adds some pain developing but provides a nice balance between memory usage and performance.