top | item 46402297

(no title)

parados | 2 months ago

Hey, thank you so much for all your hard work on psutil, it is my goto import! And this looks like a really interesting development you have created to add to the available tools for detecting those tricky memory leaks.

I have done some work in this space as well such as how to write a Python C extension without leaks in the first place [0]. This also contains a section on memory leaks, using tools like your psutil [1] This also shows where the Python documentation for C extensions contains errors, omissions or is misleading. These errors can trap the unwary.

Also I developed a Python memory tracer, pymemtrace, that uses a variety of techniques (including using your psutil!) to track memory usage at different costs and levels of granularity [2].

Now psutil 7.2.0 is out I'll update both those projects.

Thanks again for all your hard work.

[0] Project: https://github.com/paulross/PythonExtensionPatterns Docs: https://pythonextensionpatterns.readthedocs.io/en/latest/ind...

[1] https://pythonextensionpatterns.readthedocs.io/en/latest/mem...

[2] Project: https://github.com/paulross/pymemtrace Docs: https://pymemtrace.readthedocs.io/

discuss

order

ofek|2 months ago

Your C extension guide looks very useful and I quite like the foreword/history behind it. Have you considered updating the resource to account for the freethreaded mode (which will eventually become the default) on 3.14+?

parados|2 months ago

For sure, it is on my TODO list. It takes a lot of work to explore each new Python C API and I'll get around to it when I can.