add memory manager, and add test. test report that memory manager is not 100 accurate