I think that I'm having a memory leak when loading an .yml file
with the library PyYAML.
I've followed the next steps:
import yaml
d = yaml.load(open(filename, 'r'))
The memory used by the process (I've gotten it with top
or htop
) has grown from 60K
to 160M
while the size of the file is lower than 1M
.
Then, I've done the next command:
sys.getsizeof(d)
And it has returned a value lower than 400K
.
I've also tried to use the garbage collector with gc.collect()
, but nothing has happened.
As you can see, it seems that there's a memory leak, but I don't know what is producing it, neither I know how to free this amount of memory.
Any idea?