I try to load large sized images (around 3 M.o) on a PI 3B with 1 G.o memory.
Sometimes, I got the error "Out of memory heap size".
I found that it is possible to increase the Java heap size by using #VirtualMachineArgs attribute :
#VirtualMachineArgs: -Xms600m -Xmx600m
I made several trials with different sizes but I always got this error after compilation :
Invalid initial heap size: -Xms600m -Xmx600m
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
Thanks but NO
I made a trial with 100 M.o and I got the same error
I found that 600 M.o is the Heap size recommended value for 1 G.o total memory by Oracle
Dim bg As B4XBitmap = xui.LoadBitmapResize(Rep, FileName, 1920dip, 1080dip, True)
B4XImageView1.SetBitmap(bg)
I have the feeling that my issue is coming from the "speed" of loading the images. My program is a sort of "diaporama" which shows one image every second.
And I guess that some large images are not completly loaded when the program starts to load the following image !
But I did not find a way to know when image loading is 100% finished. Any idea ?
@Daestrum
I don't think the error is coming from the value (I tested different sizes and yours).