Print report during profiling
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.
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).
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?
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.