MatLab DAQ session causes memory leak when running in background mode with digital channels

3 次查看(过去 30 天)
I'm using the Session-based DAQ on MatLab 2013a with a NI PCI-6229 card. I have found that if I include digital channels (InputOnly or Bidirectional Input setting) for reading on/off signals, and I run the session in Background mode (startBackground), then the memory usage by MatLab steadily increases steadily. Stopping and resetting the session does not release this memory, nor does deleting the session.
I can attach more detailed code if necessary, but I've found that the simplest way to replicate this is to create a session with one analog and one digital channel (the analog channel clocks the digital one), have the DataAvailable callback simply plot the data ( plot(event.TimeStamps, event.Data) ), and run it.
Has anyone else encountered this issue and know a way around it?
  1 个评论
Tao Cui
Tao Cui 2017-3-31
I also have exactly this issue with session based daq using NI. When digital channels are presented in the session and when the task is started in background, memory keeps growing and eventually Matlab crashes with out of memory error. If there are only analog channels, everything works fine.
The version I have is R2015b. It has been two years since this post, has anyone came up with solutions or workarounds. Or if Matlab or NI noticed this issue.

请先登录,再进行评论。

回答(2 个)

Andrei
Andrei 2017-6-6
编辑:Andrei 2017-12-7
This is fixed in MATLAB R2017b.
A workaround is attached to this bug report .

Scott Whitney
Scott Whitney 2015-5-27
Daniel, I don't know if you are still having this problem, but I was also. In my case I have 4 analog output channels and 4 analog input channels. I have a listener for the analog input to log the data, and a listener to queue up more data for the output. The sample rates for the analog input and output were the same (100kHz). What I found was that I was queuing up the data faster than it was being transmitted out of the card. I had wanted to queue up the data in 1 second increments. The listener was calling back the queuing function after only 10000 samples were output, instead of 50000, so it kept on filling up the output buffer until matlab ran out of memory.

类别

Help CenterFile Exchange 中查找有关 Simultaneous and Synchronized Operations 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by