Python automatically handles memory management using a mechanism called garbage collection. code example
Example: python garbaze collection
import gc
gc.get_count()
gc.get_threshold()
gc.get_referrers(obj)
import gc
gc.get_count()
gc.get_threshold()
gc.get_referrers(obj)