Page 1 of 1

Matlab Box Memory Leak

Posted: Mon Oct 09, 2017 12:33 pm
by munichsimon
Hello guys,

I have a question concerning the matlab box. I use it to process my signal. But after a while OpenVibe always crashed. I have looked into it and found out, that the memory usage of OpenVibe increases extremely during the operation. I was using time-based-epoching before the box, and it seemed like all epochs were saved in memory?!

Now I am doing the epoching myself in the matlab box, so the memory usages increases slower. But still, after some hours also this would lead to a crash.

This can be also observed in the FFT-Matlab Tutorial.

My code in the simplest version producing the problem looks like this:

Code: Select all

function box_out = adaptive_process(box_in)

for i = 1: OV_getNbPendingInputChunk(box_in,1)
    [box_in, start_time, end_time, matrix_data] = OV_popInputBuffer(box_in,1);
end

box_out = box_in;
end
Am I doing something wrong? Is there a solution for this?

Thanks,

Simon

Re: Matlab Box Memory Leak

Posted: Mon Oct 09, 2017 2:16 pm
by jtlindgren
Hello Simon, which openvibe version are you using and on what OS? What Matlab version? We can try to confirm and fix.

Edit: Indeed, it seems that OV1.3.0 Matlab box leaks memory pretty badly. Can you try this attached replacement and tell us if it works better for you? Its for Windows OV 1.3.0.


Cheers,
Jussi

Re: Matlab Box Memory Leak

Posted: Mon Oct 09, 2017 5:44 pm
by munichsimon
Hey Jussi,

thanks for the very quick help!! I didn't have a lib folder anywhere in my OpenVibe directory so I put the lib folder from the zip-file just directly in the OpenVibe directory, is that correct?

On a quick try it seems like this fixed it, I'll do more testing and get back to you, if I run into more problems.


Thanks a lot,
Simon

Re: Matlab Box Memory Leak

Posted: Tue Oct 10, 2017 7:37 am
by jtlindgren
Great to hear that it works so far, and thanks a lot for the report. It seems a rather major bug, so I'm surprised no one reported it before. Maybe they use less data and/or have huge amount of RAM.

The lib/ content might indeed be unneeded runtime on Windows.

Don't hesitate to let us know if you encounter issues with it (or ov in general, of course).


Cheers,
Jussi