Hi
I my tying to make simple game,but have a trouble with java.lang.OutOfMemoryError.
My sketch by default (without any P2D,P3D) uses about 40 000 000 bytes,but i have 4gb ram and need minimum 100mb,when i am using P2D the total memory decreases to 24 000 000.
How to change the heap size in APDE sketch?
I just have tested again and changed the size of my image downto 25%(now about 5000x5000) and this worked.
It seems that android mode automatically changes the memory allocation.(now about 170 000 000).
I saw that i can’t load big images like 10000 x 5000.
java.lang.OutOfMemoryError: Failed to allocate a 738736 byte allocation with 393816 free bytes and 384KB until OOM, max allowed footprint 268435456, growth limit 268435456
at processing.core.PImage.init(PImage.java:162)
@Kvi
Your issue is available heap memory. This is restricted by Android and varies between devices. As soon as you try to use more than allowed you will get this memory error.
You can monitor how much memory your app is using and how much it is allowed to use. The following sketch shows how…