[FieldTrip] memory leak in ft_selectdata

Maximilien Chaumon maximilien.chaumon at gmail.com
Thu Oct 19 11:18:51 CEST 2017


Dear all,

I'm doing topoplots of rather large spectrum data focused on a tiny
frequency portion
    cfg = [];
    cfg.parameter = 'logmpowspctrm';
    cfg.comment = 'no';
    cfg.xlim = [20 21];
    cfg.zlim = 'maxmin';
    cfg.layout = 'neuromag306all.lay';
    cfg.colorbar = 'no';
    big_spec_grad.dimord = 'chan_freq';
    ft_topoplotER(cfg,big_spec_grad);

This used to work fine until a last update this week from a version I
suspect dated back to 03/17.
Now today, the ft_topoplotER line eats up a lot of memory
the call to "ft_prepare_layout" took 0 seconds and required the additional
allocation of an estimated 0 MB
the call to "ft_selectdata" took 0 seconds and required the additional
allocation of an estimated 1283 MB
the call to "ft_topoplotER" took 1 seconds and required the additional
allocation of an estimated 1283 MB

This gets more dramatic the second time this part of the script runs (with
2500MB added for reach topoplot) and then crashes on the next iteration
with all of 30GB RAM eaten up by this.

I traced down the memory leak to ft_selectdata line 1281 in a subfunction
called cellmatselect.
      x = x(:,selindx,:,:,:,:);
The memory usage jumps every time this dimension gets selected. (I admit I
do have a lot of frequencies, over 13000, but I need them for my
application).
Memory comes back to a normal level when the figure is closed, but as I
said, execution with another dataset eats up double the amount of memory
and I don't know how to get out of this...

Any help is much appreciated.
Thanks!
Max
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20171019/fd3c304d/attachment-0001.html>


More information about the fieldtrip mailing list