I'm trying to solve a memory problem on the RAM in a program written with Python 3.12. I used psutil to output the values of memory_maps. The program runs in Linux.
import psutil
p = psutil.Process()
for memory_map in p.memory_maps():
print(str(memory_map.path)+ " " + str(memory_map.size))
I see path=[anon] increasing. In my case very much several GB. The rest don't. My question is what could that be? What is [anon]?
You are using the wrong tool for the task and asking the wrong questions. All you can see now is, that your Python interpreter is allocating memory. You can't see where or why. That's not a problem of interpreting the data, that's a limitation of psutil. psutil just can't give you the information you need!
For your problem, you need a memory profiler like memray