Recently I was searching about NumpyArrays and I found this post about Python MemoryManager.
I tried some examples and have noticed a strange behaviour for a ndarray.data (memory view object)
As mentioned on this post, after the call print () has finished, i expect that the memory address 0x0000012044911700
is freed and returns to the top of the heap. So the next print() will utilizes the first available memory address, which is the same address 0x0000012044911700
(red rectangle).
But if I add a new cell with a print() command the memory address will change to 0x0000012044911940
(blue rectangle). With a new cell with print() it will back again to 0x0000012044911700
. And this situation repeats.
Why is it happen? Why are all addresses not equal to the first 0x0000012044911700
?