If you work with large in-memory data sets in Java, I highly recommend reading up on the Foreign Memory API.

In "normal" Java code, all your data goes on the heap and gets tracked by the garbage collector. This creates problems for large datasets (think 10GB+ in-memory analytics):
But there is officially another option as of Java 22.
Using the Foreign Memory API, you can allocate massive datasets off-heap and bypass GC entirely for that data.
Java has long had the jdk.internal.misc.Unsafe API for doing this, but the Foreign Memory API:
This is only an API you'd reach for with a specialized use case, but it's nice knowing it's there.