memory_profiler icon indicating copy to clipboard operation
memory_profiler copied to clipboard

Print report during profiling

Open mehboobali98 opened this issue 4 years ago • 3 comments

Is it possible to print the report while memory profiling is being done?

P.S. The program I wish to profile would take about an hour to run. I'd like to see the memory it is using while executing.

mehboobali98 avatar Feb 10 '22 08:02 mehboobali98

The report is printed only when the memory profiling is done. You may try to trap SIGINT (fired when you press ctrl-c) and print the report here. After every press it will print more and more complete report (no reset of the state is done when generating report).

fatkodima avatar Apr 05 '22 13:04 fatkodima

Another solution is, again, listen to some signals and then fork a separate process, that will calculate the memory profile, while the main process continues to run (similar to how redis does snapshots).

@SamSaffron Do you think this feature is worthwhile investigation?

fatkodima avatar Jan 03 '23 17:01 fatkodima

I think it is an interesting project, I don't want to complicate stuff too much too much, we need to be mindful.

Open to experimentation.

SamSaffron avatar Jan 04 '23 05:01 SamSaffron