Reputation: 71
I am developing a PyQt desktop application, on Linux, to be used in an industrial setting. It is basically a sensor data logger which displays real time graph and saves the data into a database. As it must run continuously 5 x 24 hours per week, I need to make sure there is no memory leak for it to run smoothly.
So, what is the best way to detect memory leaks in my application?
Upvotes: 0
Views: 3220
Reputation: 17335
tracemalloc
is a package included in the Python standard library.It provides detailed, block-level traces of memory allocation, including the full traceback to the line where the memory allocation occurred, and statistics for the overall memory behavior of a program.
tracemalloc
can be used to locate high-memory-usage areas of code in two ways:
A link for the documentation and PEP are below. Both provide excellent instructions on how to detect anomalies in Pythons memory management.
Upvotes: 1