I made a few changes:
import gc
from memory_profiler import profile
@profile
def test1():
a = [0] * 1024**2
del a
a = [0] * 1024**2
del a
a = [0] * 1024**2
del a
a = [0] * 1024**2
del a
a = [0] * 1024**2
del a
a = [0] * 1024**2
del a
a = [0] * 1
On 05/03/2013 07:24 AM, Michele Simionato wrote:
I have a memory leak in a program using big arrays.
Actually, big lists. Python also has arrays, and they're entirely
different.
With the goal of debugging it I run into the memory_profiler module.
Then I discovered something which is surpri
I have a memory leak in a program using big arrays. With the goal of debugging
it I run into the memory_profiler module. Then I discovered something which is
surprising to me. Please consider the following script:
$ cat memtest.py
import gc
from memory_profiler import profile
@profile
def test