How My Server Recovered from OutOfMemoryError: Java heap space

In case this could help someone…

When Yacy would not boot, because of the error:
java.lang.OutOfMemoryError: Java heap space

This got it running again, on a server with RAM: 5.8 GiB. If your server has less RAM, you might not want to try this, but most machines probably have more than this amount of RAM now, right?

export JAVA_TOOL_OPTIONS="-Xms1g -Xmx3g"
java -Xms1g -Xmx3g -classpath "lib/*:." net.yacy.yacy

After awhile of running, seeing that Yacy was working, I pressed CNTRL+C and restarted it with:

export JAVA_TOOL_OPTIONS="-Xms1g -Xmx3g"
./startYACY.sh

That is fascinating! Thank you for sharing that. I wonder what is causing that memory situation in the first place? I don’t suppose you have a text file of the verbose error output from it failing do you? If you do, I would look into it and see if I can figure out what is going on, if you are interested. :slight_smile:

The server is no longer crashing. As @roamn has shown in his reporting, the peak of the query attack appears behind us now. That strain on the servers certainly contributed to the out of memory errors.

This should also now be covered with RWIs fill out the whole memory space for YaCy · Issue #731 · yacy/yacy_search_server · GitHub