Closed jasmainak closed 7 years ago
why do you call this a memory leak? it is by design that Epochs have a ref on raw and if raw is preloaded then you have it in memory. Use memmap for raw to avoid this.
Why does the Epochs need to have a ref to raw once it is preloaded? I don't need the raw object anymore as the epochs have been created and loaded into the disk
certain functions like tf_lcmv need it but maybe this can be questioned indeed.
What is the benefit of keeping track of the original raw
when preload=True
? When loading an epochs
there is no .raw
attribute and everything seems to work ok.
then it means that functions that need Epochs.raw as tf_lcmv should require preload=False
what if you change the reject param sequentially as @jasmainak implemented some time ago?
ah ok, so it is used? Then we should leave it as it is and change the biomag demo instead.
I think this should be eventually fixed in MNE though and the lcmv examples changed.
It is counterintuitive, since the __repr__
claims that we consume less memory. I seem to remember that we used to delete the reference to raw
after loading the data in Epochs. But perhaps I am mistaken.
I don't see a problem with sequential reject param as long as the threshold gets stricter (which was enforced).
ok so maybe we can fix this....
Yeah it seems a bit silly to keep it around after preload. I'll take a look
Together with @wmvanvliet we observed a memory leak when creating epochs. Here is a script to reproduce:
Please change the number of iterations 15 before trying in your laptop if it can't handle more than 10 GB.