C CR95 Active Member Licensed User Longtime User Jun 28, 2024 #1 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. Click to expand... Please could you help,
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. Click to expand... Please could you help,
Swissmade Well-Known Member Licensed User Longtime User Jun 28, 2024 #2 You can not set this that high with 1GB of memory on your PI I think. Upvote 0
C CR95 Active Member Licensed User Longtime User Jun 28, 2024 #3 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 Upvote 0
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
Swissmade Well-Known Member Licensed User Longtime User Jun 28, 2024 #4 Maybe even don't use this parameters and let java decide. But I think that your images maybe be to much but without code we can not see if it is so. Upvote 0
Maybe even don't use this parameters and let java decide. But I think that your images maybe be to much but without code we can not see if it is so.
Daestrum Expert Licensed User Longtime User Jun 28, 2024 #5 I suppose you could try Code: Copy #VirtualMachineArgs: -Xms300m -Xmx600m (Start with 300 meg and allowed to grow to 600 meg) Upvote 0
I suppose you could try Code: Copy #VirtualMachineArgs: -Xms300m -Xmx600m (Start with 300 meg and allowed to grow to 600 meg)
C CR95 Active Member Licensed User Longtime User Jun 28, 2024 #6 Maybe even don't use this parameters and let java decide. Click to expand... If I let java decide, I get "java.lang.OutOfMemoryError: Java heap space" message I think that your images maybe be to much but without code we can not see if it is so. Click to expand... Code is simple : B4X: Copy 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). Upvote 0
Maybe even don't use this parameters and let java decide. Click to expand... If I let java decide, I get "java.lang.OutOfMemoryError: Java heap space" message I think that your images maybe be to much but without code we can not see if it is so. Click to expand... Code is simple : B4X: Copy 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).