DEV Community

Garbage Collection in Python

Prashant Sharma on November 23, 2019

In languages like C or C++, the programmer is responsible for dynamic allocation and deallocation of memory on the heap. But in python programmer d...
Collapse
 
juancarlospaco profile image
Juan Carlos

If you are interested to play with GC, using Nim you can play with 6 GC,
choose and customize, including Rust-like one, Real-Time, Go lang one, No GC (manual).

For Python it works like Cython basically, it has a --gc: CLI param, that can choose the GC, also a GC_statistics() that print info,
you can turn on and off the GC on the fly from the code and more.
Some GC that books say are slow, are actually pretty fast in practice.
Good post, interesting.

Collapse
 
sharmapacific profile image
Prashant Sharma

@juan Thanks for sharing, Sure I will play with GC.