pythonpython-2.7flaskponyorm

Memory profiling of a running python application


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?


Solution

  • Scalene is able to generate profiling output every N seconds.