When it happens, the garbage collector not only gives you the memory you need to store the value, but it also creates a counter. Reference countingĮvery time you create a new value (whatever it is, a number, string, object, etc.) Python needs to allocate memory for that new value. The memory deallocation mechanism relies on two implementations: reference counting and generational garbage collection. A garbage collector is a module responsible for automated allocation and deallocation of memory. In this article, I am going to show you how memory management works in Python, and how it affects your code running in Jupyter Notebook.įirst, I have to describe the garbage collection mechanism.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |