🎃 Jupyter plugin! New output formats! Find temporary allocations! #244
godlygeek
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Happy Halloween, everyone!
We've just released version 1.4.0 of Memray, to help you stop any spooky memory leaks from ruining your night! 🦇
You can check out the release notes for all the details, but here's a quick rundown of the major highlights:
There's a new IPython extension, which provides a Jupyter magic function that lets you run a memory profile of a code block directly in Jupyter, and see the flame graph right in your notebook! For people who primarily work in notebooks, this should be a huge usability improvement. For now, we only support flame graphs, but we're open to supporting other types of reports in the future - let us know if there are other report types you'd find especially helpful in your notebooks!
Once you've installed the new version of Memray, you can try this new feature out by opening a Jupyter notebook and running:
followed by something like:
We've also added a new subcommand,
memray transform
, which can be used to convert our output file to other formats suitable for ingestion into other tools. For our first release with this feature we've included the ability to convert the Memray capture file to two other formats. First, you can convert to a CSV, which lets you easily analyze the captured data using something like pandas, giving you total control over how the data gets sliced and presented. Second, you can transform the capture file to the input format expected by the gprof2dot tool, which lets you generate reports like this:Another exciting improvement is a new mode added to the reporters, enabled with
--temporary-allocations
. This mode aims to show where you're performing allocations that are very short lived, as these types of allocations can often point to places that can be better optimized, for instance by requesting more memory right from the start. The docs go into detail on what we mean by "temporary allocations", so check them out and try the new feature out!Feel free to open an issue if you find any problems haunting this release. 👻 And as always, you can open a discussion thread if you have any feedback or questions.
Happy debugging, and thanks as always for being a part of our community! 🧡
Beta Was this translation helpful? Give feedback.
All reactions