fix problem in the calculation of mmap size