Add ,-Xmx6g
at the end of the command line. This should give you 6GB of heap space, which is hopefully enough.
I have a similarily large project (Interrogation) and when I was actively working on it I would have this in my ~/.zshrc
(if you use Bash, put it in ~/.bashrc
) to help and I would run it after every Defold update:
patch-defold-heap() {
sed -i "" -e 's/,-Xmx6g//' -e 's/vmargs = \(.*\)$/vmargs = \1,-Xmx6g/' /Applications/Defold.app/Contents/Resources/config
}
(Also I needed this only on my laptop which has 8GB of RAM. Java calculates the default max heap size based on the system’s installed memory and on my laptop that would be lower than on my 16GB desktop)