~/talk

Native Interoperability with JDK 25 and the FFM API

Talkat JavaOne 2026 · 2026-03-17..03-19· [java]
github:minborg
slides:none on file

JDK 25 ships the finalized Foreign Function & Memory API so Java can allocate and manage native memory as memory segments and free it deterministically via deterministic arenas instead of relying on JNI or ByteBuffers. Live code shows struct-like MemoryLayout, varhandles for atomic and multi‑dimensional access, zero‑length null segments, and linking native functions to Java via method handles and functional interface glue. A demo uses jextract generates ONNX bindings to call ONNX Runtime and the examples (PID, strlen, small model inference) run successfully.

AI-written summary · about

  1. 0:00JDK 25 and FFM API intro
  2. 1:22Legacy memory handling issues
  3. 9:28Memory segments in FFM API
  4. 11:53Arenas for memory lifecycle
  5. 15:50Memory layouts and value types
  6. 19:01Var handles for memory access
  7. 23:56Mapping memory to Java objects
  8. 27:28Record mappers for snapshots
  9. 31:22Byte buffers and arrays interop
  10. 32:25File memory mapping with FFM
  11. 33:29Shared arenas and thread safety
  12. 35:15Multi-dimensional arrays
  13. 38:04Advanced memory segment ops
  14. 40:30Linking Java to native functions
  15. 42:39Java interfaces for native calls
  16. 45:11Automating bindings with JExtract
  17. 46:14FFM API benefits summary
  18. 47:39Live demo: ONNX sentiment analysis
  19. 50:30Q&A
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.