Matlab Box Memory Leak

Concerning processing components: filters, file load/save, visualizations, communication ...
Post Reply
munichsimon
Posts: 3
Joined: Thu May 11, 2017 9:37 pm

Matlab Box Memory Leak

Post 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

jtlindgren
Posts: 775
Joined: Tue Dec 04, 2012 3:53 pm
Location: INRIA Rennes, FRANCE

Re: Matlab Box Memory Leak

Post 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
Attachments
matlab-plugin-memory-leak-fix.zip
(101.2 KiB) Downloaded 195 times

munichsimon
Posts: 3
Joined: Thu May 11, 2017 9:37 pm

Re: Matlab Box Memory Leak

Post 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

jtlindgren
Posts: 775
Joined: Tue Dec 04, 2012 3:53 pm
Location: INRIA Rennes, FRANCE

Re: Matlab Box Memory Leak

Post 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

Post Reply