erase mempage and rewrite directly