Skip to content

Commit 63dde4b

Browse files
committed
Customize GC behavior differently
By default, the JVM does not free allocated heap back to the OS. This configures away from that behavior, hopefully to prevent OOM engine errors. It replaces the existing configuration which put absolute size limits on the heap. See http://www.stefankrause.net/wp/?p=14 for details on the specific options chosen. This configuration brought my test repository's memory usage down from ~700MB to ~250MB. Its graph also shows most closely the pattern we'd prefer: the slope of allocated heap closely matching used.
1 parent 5183658 commit 63dde4b

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

Diff for: Dockerfile

+1-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ RUN npm install
2525

2626
USER app
2727

28-
# starting heap, max heap
29-
ENV JAVA_OPTS="-Xms512m -Xmx1280m"
28+
ENV JAVA_OPTS="-XX:+UseParNewGC -XX:MinHeapFreeRatio=5 -XX:MaxHeapFreeRatio=10"
3029

3130
CMD ["/usr/src/app/bin/duplication"]

0 commit comments

Comments
 (0)