Java memory map, read / write in 4k or 8k blocks for SSD?

I have an SSD that has an internal page size of 8k, but linux only supports 4k pages. My question is that when using files with mapping in java memory, I get better read / write performance in 4k or 8k blocks at a time. I am creating a disk-based hash map using memory mapped files, where each bucket is a 4k or 8k block. if ssd reads 8k, even if I only get access to the first 4k from it, then it seems that I should use 8k blocks, since I lose half of my readings otherwise. However, since linux only works in 4k blocks, I don't know if there will be overhead for reading two pages from an OS point of view, even if there is only one page from an ssds point of view, if you get my jist.

+4
source share
1 answer

You can avoid the need to choose the block size as a whole using open addressing. Then let the OS and hardware do the work of determining the most efficient way to perform each operation.

0
source

Source: https://habr.com/ru/post/1483872/


All Articles