fix madvise bug to improve performance