I have a Python package I am benchmarking for virtual memory used.
At the moment, this isn't very precise. I submit the script e.g.
python script1.py
and look at the time and resources used in order to execute.
Is there some package/method to find out where my RAM bottlenecks are? I'm thinking of a tool like
ram_used python script1.py
that would keep track of how much RAM is used.
Does such a thing exist?
解决方案
Yes, there is - It's called memory_profiler. Once you've gone through and added the @profile decorator to the functions you would like to profile, you can use;
python -m memory_profiler example.py