Whenever Python exits, why isn’t all the memory de-allocated?

why isn’t all the memory de-allocated

How do you see that?

Isn’t that what the garbage collection is used for?

Garbage collection is the process of destroying objects that are no longer used during the running of a program. Python does that automatically. But even in the unlikely case that you had found a memory leak inside of the CPython interpreter, unless you are running in some very special kind of environment, the operating system itself will release all memory consumed by a process upon termination.

1 Like