add memory mgnt test code