Master the fundamental concepts of jvm internals through this focused micro-challenge.
\`-XX:+PrintCompilation\` prints one line each time HotSpot compiles a method. Reading that log connects bytecode behavior to real JIT decisions.
Typical fields:
A line like \`1234 4% 3 com.example.Hot::loop (50 bytes)\` means compile ID 4, C1 compile, level 3, for method \`loop\` of 50 bytecode bytes.
Pair with \`-XX:CompileThreshold\` to see how invocation counts influence promotion. Profiling builds on the same counters.
For example, run a tight loop one million times, watch \`PrintCompilation\` fire, then compare wall time before and after the compile line appears.
Correlate compile log timestamps with wall-clock improvements on the same method. A C2 compile that inlines a callee can remove more dispatch than the root method's bytecode size suggests.
This exercise asks you to document JVM flags and sample \`PrintCompilation\` output. You will explain how to read compile tiers from log lines and tie them to the tiered compilation model.
You will use the same mental model here when reading production interpreter source later in the track. Sketch one concrete input on paper, predict the outcome, then confirm with code. That discipline catches logic errors early and makes debugging far faster when you extend the implementation in follow-on tasks.
Write a C program that documents how to interpret PrintCompilation output.
Requirements:
Three hints are available for this task, revealed one at a time inside the code workspace so you can struggle productively before seeing them.
All starter code and reference implementations are available for your local setup.
View on Github