Created
December 15, 2016 15:12
-
-
Save topiaruss/431f36deadc77b1a3f30e8633c4fdba3 to your computer and use it in GitHub Desktop.
Java heap constraints in docker-compose
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '2' | |
services: | |
test-java-params-none: | |
image: iron/java:1.8 | |
command: sh -c " java -XX:+PrintFlagsFinal -version|grep -i heapsize|egrep 'Initial|Max'" | |
test-java-params-cmd-line: | |
image: iron/java:1.8 | |
command: sh -c "sleep 2; java -Xms64m -Xmx128m -XX:+PrintFlagsFinal -version|grep -i heapsize|egrep 'Initial|Max'" | |
test-java-params-from-dot-env: | |
image: iron/java:1.8 | |
command: sh -c "sleep 4; java ${MEM_OPTS} -XX:+PrintFlagsFinal -version|grep -i heapsize|egrep 'Initial|Max'" | |
test-java-params-from-shell-env: | |
image: iron/java:1.8 | |
environment: | |
- _JAVA_OPTIONS=-Xms64m -Xmx160m | |
command: sh -c "sleep 6; java -XX:+PrintFlagsFinal -version|grep -i heapsize|egrep 'Initial|Max'" | |
test-java-params-from-env-file: | |
image: iron/java:1.8 | |
env_file: | |
- tight-mem.env | |
command: sh -c "sleep 8; java -XX:+PrintFlagsFinal -version|grep -i heapsize|egrep 'Initial|Max'" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_JAVA_OPTIONS=-Xms12m -Xmx28m |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment