Python memory management and Garbage Collector's tough lifeЯзык Python, его эволюция и использование
I'm a co-founder and chief technical officer in VXSoft LLC, which is developing web-based products, widely used in governmental institutions. I've started my programmer's career as a C++ and C developer, mostly working on desktop based game development, but after 2-3 years I've switched to web-development with PHP (for 7 years) and now working mostly with Python (3+ years). Beside the development I'm also involved in software design and architecture processes of more than 10 different systems.
Corporate email: email@example.com
The target of this talk is to clarify and discuss Python's garbage collector's (GC) internal structure and the way it is working. But to fully understand the algorithms and internal structure of GC, one should understand how Python keeps variables in the memory and what kind of structures Python uses to support GC.
So the first thing we're going to discuss is Python's memory management with following subsections:
- What is variable and why is everything is an object in Python.
- What information is stored in objects and what is reference count.
- How and where exactly (looking at the CPython C implementation source codes) Python modifies reference counts.
- Run example codes to demonstrate the reference count modifications.
The second thing we're going to discuss is Python's garbage collectors (GC) structure with following subsections:
- Why GC is needed and how reference counting based GC is working.
- What is cycling referencing and what are possible solutions to it.
- Python's implementation of generational garbage collector.