Re:Measuring memory usage in Python: it’s tricky
by singhrac on Monday July 05, 2021 @07:01PM
(#27742640)
Having done a serious amount of Python memory profiling work in the past, both Fil and Scalene are useful tools. Add them to your list along with runsnakemem and the high level memory-profiler.
On the time profiling side I highly recommend py-spy and pyflame (a little less updated).
If your goal is to find peak memory usage, which is what you care about in data processing batch processes, Fil is probably a better choice (https://pythonspeed.com/fil).