C heap introspection in psutil
gmpy.dev·5d·
Discuss: Hacker News
🔍Memory Profilers
Preview
Report Post

C heap introspection in psutil

Memory leaks in Python are often straightforward to diagnose. Just look at RSS, track Python object counts, follow reference graphs. But leaks inside C extension modules are another story. Traditional memory metrics such as RSS and VMS frequently fail to reveal them because Python’s memory allocator sits above the platform’s native heap (see pymalloc). If something in an extension calls malloc() without a corresponding free(), that memory often won’t show up where you expect it. You have a leak, and you don’t know.

psutil 7.2.0 introduces two new APIs for **C…

Similar Posts

Loading similar posts...