Off-heap memory in Java refers to memory outside the JVM heap, meaning it is not managed by the garbage collector. To allocate off-heap memory, developers use either the legacy ByteBuffer API (introduced in Java 4, circa 2002) or the newer Memory API introduced in Java 22. The Memory API is safer and supports long-based indexing instead of int-based, making it better suited for 64-bit systems. Off-heap memory is useful for mapping large files into memory without GC interference.
•1m watch time
Sort: