DAQ toolbox memory leak

조회 수: 3 (최근 30일)
Gary Wolf
Gary Wolf 2016년 4월 19일
댓글: Lucie S. 2022년 1월 10일
I've been using without problem the Data Acquisition toolbox with a NI PCIe-6363 acquisition card. I now need to acquire repeatedly large number of points (~1-10e6 from 1 analog input and 2 digital inputs) and this has proved to be a problem with the toolbox. While it does work, every call for acquisition (startForeground function) increases the memory used by Matlab by few Mb (~10% of the data size to acquire), and after a while gets > 10 Gb memory and Matlab stops. Just doing in a for loop startForeground + the memory function shows clearly that each call leaks some memory, and no "clear" can release that memory.
Update 1: It appears the memory leak is only in the presence of digital inputs. If they are replace by analog input, then there is no issue, though this is not a viable solution as the DAQ acquisition rate cannot be as high then.
Any help is appreciated! Thanks.
  댓글 수: 3
Tao Cui
Tao Cui 2017년 3월 31일
I also have this issue with NI in daq session. 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 will be fine.
The version I have is R2015b. It has been a while since this post, could you let me know if you found a solution.
Gary Wolf
Gary Wolf 2017년 3월 31일
Sorry, I could not find a solution to this issue (also with R2015b).

댓글을 달려면 로그인하십시오.

답변 (2개)

Tao Cui
Tao Cui 2017년 4월 25일
편집: Tao Cui 2017년 4월 25일
The root cause to this problem is the handleDataAvailable method in "AsyncIOInputChannel.m" of daq toolbox's NI interface part. It is even clearly labeled by Mathwork developers in the comment on line 134: "!!! Bug, this only handles results from a single task". Not sure if this will be fixed in their future version.
What happened is when there are both digital card and analog card, or when there are both input card and output card running in a session in background mode, there will be two tasks running in asynchronous mode handled by this method. However, this method cannot handle two tasks properly, hence cause memory problem.
Not necessarily an answer, but I hope this info at least can help others or Mathwork developers to patch this bug.

Andrei
Andrei 2017년 6월 6일
편집: Andrei 2017년 12월 7일
This is fixed in MATLAB R2017b.
A workaround is attached to this bug report .
  댓글 수: 1
Lucie S.
Lucie S. 2022년 1월 10일
I have similar issues with Matlab 2021b (all my drivers up-to-date) and I'm only using one input channel of a cDAQ-9191 + NI 9223 card. Memory keep growing during acquisition, only close matlab release the 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