I have a flask application that uses pony as its ORM. The application incrementally increases its memory usage with every request to the service. I need to measure the memory usage of different parts of the program to find the problem.
Unfortunately, as the program does not return its execution and is always running I could not use memory profiling tools such as memory_profiler. How can I profile memory usage of a continuously running application?
1 Answer
Scalene is able to generate profiling output every N seconds.
1 Comment
Dan Nissenbaum
But, how to run Scalene with a Flask app?
perf-mem,perf-kmemandpref-record. You can continuously record stats withperf-recordand then analyse usingperf-stat.