NOTE
JVM Object Creation
From bytecode allocation through class readiness, heap allocation, zero initialization, object headers, and Java constructor execution.
This is a historical learning note and may contain outdated or incomplete understanding.
At a high level, creating an ordinary object involves:
- resolving/using the target class and ensuring required class initialization semantics are satisfied;
- obtaining storage from the managed heap through the allocator/collector;
- establishing the object’s VM metadata/header and default-zeroed instance state;
- executing constructor logic, including superclass constructor chaining, according to Java rules;
- publishing the resulting reference according to the surrounding program’s synchronization semantics.
The exact allocator path—TLAB, shared allocation, region handling, GC slow path—is a HotSpot/collector implementation detail.
Also distinguish allocation from safe publication. Constructing an object does not by itself make unsynchronized publication to another thread safe.