Memray is an open source memory profiling program for Python developed by Bloomberg. Bloomberg has over 3,000 software developers who encrypt Python, as well as a Python infrastructure team to support those developers.
The team created Memray to enable developers to analyze their memory allocation, allowing them to reduce memory usage, detect leaks, and identify memory hotspots in the code.
The tool was recently open source so that Python developers around the world could take advantage of it.
Some key features of Memray include tracking every function call, handling natural calls in the C / C ++ library, generating reports, and the ability to work with both Python and natural threads.
According to Bloomberg, some of Memray’s advantages include speed, collecting large amounts of data, being able to activate and deactivate at runtime, and showing the combined Python stack and C / C ++ for each distribution so that memory can be understood. is distributed in its own extensions.
“There are some great open source profilers who know where a Python program spends its time. However, there weren’t many great solutions to find out where a Python program spends its memory, especially when that memory is allocated by its own expansion module. I hope that the next time someone wonders why a script uses so much memory, they will be able to understand it without having to change anything in their program other than the way they run it, “said Pablo Galindo Salgado. member of the Python Infrastructure Team at Bloomberg, c interview published on the Bloomberg blog.