Skip to content

Commit 3d88dbc

Browse files
committed
Memoery options added to docker to reduce heap dumps
1 parent 04f4556 commit 3d88dbc

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎Dockerfile‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ COPY data /tag/data
3939

4040
COPY --from=build /app/target/tag-classes.jar /tag/tag-classes.jar
4141

42+
# In a container Java's heap defaults to a quarter of its memory limit (docker run --memory); MCTS opponents need more.
43+
# On running out of memory, Java writes a heap dump to /tmp, to copy out with docker cp.
44+
# Override with docker run -e JAVA_TOOL_OPTIONS=...
45+
ENV JAVA_TOOL_OPTIONS="-XX:MaxRAMPercentage=75 -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/tmp"
46+
4247
# For the WebServer entry point
4348
EXPOSE 8080
4449

0 commit comments

Comments
 (0)