Library for fast mapping of Java records to native memory

Java gets a slick new memory tool, but commenters are already fighting over whether it’s genius or pointless

TLDR: TypedMemory is a new Java library that makes it easier to store structured data outside normal app memory, aiming at faster, more controlled programs. Commenters are split: some love the clean design, while others say it may ruin its own speed benefits and are already asking why anyone wouldn’t use something else instead.

Java just got a flashy new toy: TypedMemory promises to let developers store structured data in a big block of native memory using simple Java record classes, instead of wrestling with fiddly low-level code by hand. In plain English, it’s trying to make a notoriously painful part of Java feel less like assembling furniture with missing screws. The pitch is clear: cleaner code, type safety, and more control for people building games, simulations, graphics tools, and other speed-hungry software. The catch? It’s still experimental, only works on Java 25+, and needs extra launch flags that instantly made some readers squint.

And oh, the comments came ready to rumble. One camp was immediately into it, calling the API "very clean" and comparing the vibe to C#’s beloved Span type — basically the software equivalent of, “Wait… this actually looks nice?” But the skeptics were louder. The harshest take was that Java desperately needs this kind of feature, but the library may undercut its own performance dreams by still creating objects when reading and writing data. Translation: some people think it solves a pain point while also reintroducing the exact overhead high-performance fans are trying to escape.

Then came the classic comment-thread chaos: “Why not use graal?” dropped like a drive-by grenade, while another reader demanded to know how this stacks up against existing performance tools and whether it’s really helping or just repackaging complexity with prettier wrapping. The result is peak developer drama: half the room sees a much-needed quality-of-life upgrade, the other half sees a shiny shortcut that might miss the point entirely.

Key Points

  • TypedMemory is an experimental Java 25+ library for mapping Java record types onto contiguous off-heap memory using the FFM API.
  • The library provides typed memory access through APIs such as `Mem.of(...)`, `get(index)`, and `set(index, value)`, while preserving low-level memory layout control.
  • Current features include typed allocation, record layout derivation, typed access, wrapping existing segments, reinterpretation support, bulk operations, nested structured data, and fixed-size array fields.
  • Planned future features include pointer-typed fields beyond manual `long` addresses and support for unions.
  • TypedMemory targets Java 25, is built with Maven, requires native-access flags for reinterpret calls, and is available on Maven Central as version 0.1.0.

Hottest takes

"Java desperately needs an array of struct" — wood_spirit
"Nice. Very clean api." — kosolam
"Why not use graal?" — usernametaken29
Made with <3 by @siedrix and @shesho from CDMX. Powered by Forge&Hive.