Oracle software engineer Lois Foltan merged JEP 401: Value Objects into the OpenJDK master branch this week [1].
This change represents a fundamental shift in the Java programming language. By introducing value classes, the project aims to rewrite how Java handles object identity to reduce memory usage and improve overall system performance [2].
The update is part of Project Valhalla, a long-term effort to modernize the Java Virtual Machine. Value classes allow developers to create objects that are treated like primitive types, meaning the system cares about the data they hold rather than their specific memory address [2]. This optimization removes the overhead associated with traditional object headers, which often slows down large-scale data processing.
The scale of the implementation is significant. A reporter from The Next Web said, "It took 197,000 lines of code" [2]. This massive injection of logic into the OpenJDK master branch prepares the groundwork for the feature to eventually arrive in JDK 28 [2].
Developers have long sought a way to achieve the performance of primitives without losing the benefits of object-oriented programming. The introduction of value classes addresses this gap by allowing the JVM to flatten data structures in memory. This prevents the "pointer chasing" that typically occurs when the system navigates through layers of object references [2].
While the code is now in the master branch, the feature remains in a preview state. This allows the community to test the implementation and provide feedback before the final release in JDK 28 [2]. The merge marks one of the most significant structural changes to the language since its inception, altering how the machine interacts with basic data units [1].
“It took 197,000 lines of code.”
The integration of JEP 401 signals a transition toward high-performance computing within the Java ecosystem. By reducing the memory footprint of objects and improving data locality, Java becomes more competitive for memory-intensive applications and big-data processing, potentially reducing the need for developers to rely on complex off-heap memory management.


