7

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?

2
  • 1
    memory_profiler can write to stream or standard log file. Commented Jan 30, 2020 at 22:15
  • 1
    Please take a look at perf-mem, perf-kmem and pref-record. You can continuously record stats with perf-record and then analyse using perf-stat. Commented Apr 9, 2022 at 12:54

1 Answer 1

1

Scalene is able to generate profiling output every N seconds.

Sign up to request clarification or add additional context in comments.

1 Comment

But, how to run Scalene with a Flask app?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.