I'm running B4A (latest version 8.30) on a Windows 10 Pro computer with an i5 processor and 24GB or RAM. The "Convert byte code - optimized dex." takes 18.14s. I want to speed up the process and tried to increase MaxRamForDex from 1024 to 2048. Unfortunately for any value over 1024 I get the following error:
Error occurred during initialization of VM
Could not reserve enough space for 2097152KB object heap
My system has more than 16GB of free RAM (from the existing 24GB), so for sure this is not an issue.
I'm using 16 bit java, I was not aware that B4A already supports 64-bit Java.
I've tried again with 64-bit Java and the result is the same:
Error occurred during initialization of VM
Could not reserve enough space for 2097152KB object heap
You should manually increase/set your Java Options settings in Windows Environment Variables to -Xmx512m -Xms512m which is what mine is set to. You can actually set it to anything you like for example -Xmx1024m -Xms1024m etc, this might fix your issues.
Looking again in the Config Paths I've seen that it was reverted back to 32bit Java, even if previously saved with 64bit java.
Tried again and now I'm able to use even MaxRamForDex=8192 , but unfortunately Convert byte code still takes ~18s same as with x86 java and MaxRamForDex=1024.
I don't know what else to try to speed up the process...
1. It is slower in release mode.
2. The time should change based on the optimized dexer state. If you check it by compiling frequently then it will always be slow.
You should manually increase/set your Java Options settings in Windows Environment Variables to -Xmx512m -Xms512m which is what mine is set to. You can actually set it to anything you like for example -Xmx1024m -Xms1024m etc, this might fix your issues.