2 ms·You don't even have to go through Unsafe. ByteBuffer.allocateDirect() gives you a chunk of off-heap memory.by the8472 9y agoYou don't even have to go through Unsafe. ByteBuffer.allocateDirect() gives you a chunk of off-heap memory.