java.lang.OutOfMemoryError: MicroUI: Not enough room to allocate the Image's native data

Hi,

When starting my application in the S3 I have the following error:

Exception in thread "main" java.lang.OutOfMemoryError: MicroUI: Not enough room to allocate the Image's native data.
at java.lang.Throwable.fillInStackTrace(Throwable.java:82)
at java.lang.Throwable.<init>(Throwable.java:37)
at java.lang.Error.<init>(Error.java:18)
at java.lang.VirtualMachineError.<init>(VirtualMachineError.java:10)
at java.lang.OutOfMemoryError.<init>(OutOfMemoryError.java:20)
at ej.microui.display.ImageOutOfMemoryVisitor.callRun(ImageOutOfMemoryVisitor.java:35)
at ej.microui.display.ImageOutOfMemoryVisitor.callRun(ImageOutOfMemoryVisitor.java:16)
at ej.microui.display.Image.openOffscreen(Image.java:549)
at ej.microui.display.Image.allocateImage(Image.java:528)
at ej.microui.display.Image.createImage(Image.java:78)
at ej.microui.display.Image.createImage(Image.java:67)

The problematic line is:

Image.createImage(width, height); // width=480, height=272

What can I do to solve this issue? Thanks.

NB: I have this problem since I upgraded my UI pack from 9.4.1 to 11.2.0. I’m using MicroEJ SDK 4.1.5.

Best,

Hi @gjadi,

You can change the size of the Image Heap size in the Run Configuration of your application: Tab Configuration > MicroUI > Memory Section > Images heap size (in bytes).

Regards,
Gaëtan for MicroEJ

Thanks, that did the trick!