[FieldTrip] memory leak in ft_selectdata
Schoffelen, J.M. (Jan Mathijs)
jan.schoffelen at donders.ru.nl
Fri Oct 20 09:07:10 CEST 2017
>From your (otherwise clear) description, I am not sure whether your issue is due to the actual data selection itself. Rather, my first thought would be that something goes amiss with recursive piling up of large amounts of irrelevant (for the plotting at least) metadata, that gets assembled while iterating through subsequent interactive plotting steps.
It’s kind of a long story, which I am not going to type down here, but to check whether I am thinking into the right direction, could you see whether your problem persists if you call ft_topoplotER in the following way?
ft_topoplotER(cfg, rmfield(big_spec_grad, ‘cfg’));
> On 19 Oct 2017, at 11:18, Maximilien Chaumon <maximilien.chaumon at gmail.com> wrote:
> 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';
> 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.
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
More information about the fieldtrip