Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@philipz
Last active October 6, 2019 05:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save philipz/e2d3cec640c285051208adf3461069a5 to your computer and use it in GitHub Desktop.
Save philipz/e2d3cec640c285051208adf3461069a5 to your computer and use it in GitHub Desktop.
JVM opts in Docker

For 8u212+

docker run -d -p 8080:8080 -e "JAVA_TOOL_OPTIONS=-Djava.security.egd=file:/dev/./urandom -XX:InitialRAMFraction=2 -XX:MinRAMFraction=2 -XX:MaxRAMFraction=2 -XX:+UseG1GC -XX:MaxGCPauseMillis=100 -XX:+UseStringDeduplication" -m 1g myimage

docker exec -ti 16f7 java -XshowSettings:vm -XX:+PrintCommandLineFlags -version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment