use mmap replace read/write