add function that the memory info can be saved to local dir