You might remember the brief discussion on the method of memory management in Python in Chapter 15, The Global Interpreter Lock. In this section, we will look at the Python memory model in greater depth by comparing its memory management mechanism to those of Java and C++ and discuss how it relates to the practices of concurrent programming in Python.
Python memory model
The components of Python memory manager
Data in Python is stored in memory in a particular way. To gain an in-depth understanding on a high level, regarding how data is handled in concurrent programs, we first need to dive deep into the theoretical structure of Python memory allocation. In this section, we will discuss how data is allocated in a private heap...