Memory management in Python involves a private heap containing all Python objects and data structures. The management of this private heap is ensured internally by the Python memory manager.names>reference>objects
Python is writen by C language and the memory managed by a private heap.Heap memory is essentially a large pool of memory (typically per process) from which the running program can request chunks. This is typically called dynamic allocation.
Follow the linkhttps://docs.python.org/3/c-api/memory.html