Project Valhalla's JEP 401 (Value Classes and Objects) has re-entered candidate status and a new early-access build is available. The episode explains the core concept: Java instances currently all have identity, which enables mutability and synchronization but adds memory overhead (object headers, heap fragmentation, cache misses). JEP 401 introduces the `value` keyword for classes and records, stripping identity from their instances. Value objects become shallowly immutable, use field-wise `==` comparison, and cannot be synchronized on. About 30 JDK classes including primitive wrappers, Optional, and java.time types will become value classes. The EA build at jdk.java.net/valhalla lets developers try these features today using `--enable-preview`. Brian Goetz also addresses runtime performance optimizations and the perennial 'Valhalla, when?' question.
Sort: