Debugging and profiling techniques
summary
Shows how to locate CPython leaks with concrete commands: use gc.get_referrers and sys.getrefcount to find hidden references, force collection with gc.collect, inspect gc.garbage for uncollectable objects, and expect surprising results like the collector freeing four objects (instances plus their __dict__ entries) for a two-object cycle. Covers weakref callbacks and finalize as __del__ workarounds, profiling with cProfile and timeit plus pstats/runsnake, C-level tools (valgrind/oprofile), and Windows pitfalls around MSVCR CRT versions, Dependency Walker and build flags (/MD /Zi).
AI-written summary · about
chapters (9)
- 0:00Debugging and profiling intro
- 1:27Memory and resource leaks
- 17:02Reference counting basics
- 25:53Debugging reference cycles
- 35:33Leak detection tools
- 43:05Profiling with timeit and cProfile
- 1:00:11Advanced profiling techniques
- 1:06:16Debugging C++ extensions on Windows
- 1:21:34Q&A
related talks
29mLiberating the Debugging Experience with the GDB Python API
34mHow to Debug Anything
14mDebugging debuggers!!!
17mWho Takes Out Your Trash
01h 01mBeyond step-by step debugging in Visual Studio
01h 01mBack to Basics: Debugging in Cpp
29mPeering into the black box: tips for visualizing your program's behavior
18mPreview: Verification (Correctness & Debugging)
