How the JVM Creates a Java Thread
· One min read
Calling Thread.start() asks the JVM to create a new execution thread. Calling run() directly does not create a thread; it executes on the current caller.
Calling Thread.start() asks the JVM to create a new execution thread. Calling run() directly does not create a thread; it executes on the current caller.
The Java Virtual Machine provides a managed execution environment for bytecode. Understanding its memory model, class lifecycle, execution engine, and diagnostics makes Java failures easier to explain and tune.
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.