That’s it ! I found what’s working !
First, in the terminal I entered :
java -XshowSettings 2>&1 | grep Heap
This told me the recommended heap size, and it was “1.03G”.
Then in the 161.sh file, I added
export JAVA_TOOL_OPTIONS="-Xmx1g"
(and not “Xmx1.03g” because it doesn’t work)
under the line :
export CCACHE_SIZE=100G
(that I changed to 50G by the way)
I saved the modifications, and I ran the 161.sh scrip and no OutOfMemoryError anymore !
I will now test the build I made.
This script is just better than the docker method for everything, I don’t see one positive point for docker. Thank you a lot !