Essential Java Startup and JVM Arguments Explained
· 2 min read
This note explains a typical Java startup command used while running load tests on Linux:
java -server \
-XX:+HeapDumpOnOutOfMemoryError \
-Xms512m \
-Xmx512m \
-XX:+UseG1GC \
-XX:MaxGCPauseMillis=250 \
-XX:G1ReservePercent=20 \
-Djava.security.egd=file:/dev/urandom \
-jar xxxx.jar
JVM options must appear before -jar or the main class. Application arguments belong after the JAR name or main class. When diagnosing startup problems, record the exact command, Java version, environment variables, operating-system limits, and container memory limits.