The article walks through the JVM’s internal steps that turn a simple `new User()` statement into a fully formed Java object, detailing memory allocation, the object header’s type pointer, the Klass structure, and why methods are stored at the class level rather than in each instance.
This article thoroughly examines Java's synchronized keyword, covering its three usage forms, the underlying bytecode instructions, how lock information is stored in the object header's Mark Word, the step‑by‑step lock upgrade process from no‑lock to heavyweight, and JVM optimizations such as lock elimination and coarsening, providing interview‑ready explanations.
This article explains JEP 519’s Compact Object Headers in Java 25, detailing how reducing the object header from up to 128 bits to 64 bits cuts memory overhead, improves cache locality, lowers garbage‑collection pressure, and delivers measurable performance gains for JVM workloads.
This article explains the three-part structure of a Java object in the HotSpot JVM—object header, instance data, and alignment padding—detailing the Mark Word and Klass Pointer fields, their bit‑level layout, and how they affect memory size, GC age, and locking behavior.
This article explains Java’s synchronized keyword, covering its usage on methods and blocks, the underlying object header and monitor structures, and the lock‑upgrade process from no lock through biased, lightweight, and heavyweight states, illustrated with code samples and diagrams.
This article explains the Java synchronized keyword, covering its basic usage on methods and code blocks, the underlying monitor mechanism, object header layout, lock states such as biased, lightweight, and heavyweight locks, and provides detailed code examples and JVM internal implementations.
This article provides a comprehensive analysis of the HotSpot JVM implementation of the synchronized keyword, covering object header layout, the three lock states (biased, lightweight, heavyweight), their acquisition and release processes, bytecode differences, and practical code examples to help readers understand Java concurrency internals.