add memory manager,not complete