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