3 ms·
> when you do use Java NIO MappedByteBuffer, we still have to copy to a temporary byte[] in order to do any real processing Does anyone know why this is the ca
by bajsejohannes 15y ago
> when you do use Java NIO MappedByteBuffer, we still have to copy to a temporary byte[] in order to do any real processing
Does anyone know why this is the case?
- shin_lao 15y agommap uses the virtual memory manager to map a file into virtual memory as it does for swapping. The memory you have is therefore allocated by the kernel of your operating system and oblivious to any garbage collector you might have.
- nvarsj 15y agoWell, with a MappedByteBuffer (or any DirectByteBuffer), if you want to manipulate the data as a Java type (e.g. byte[]) you have to copy the data into the heap. byte[] cannot exist outside of the heap. Still, I wonder why they're using a MappedByteBuffer in the first place if they're working with the data in the Java heap.