DAQ toolbox memory leak

3 vues (au cours des 30 derniers jours)
Gary Wolf
Gary Wolf le 19 Avr 2016
Commenté : Lucie S. le 10 Jan 2022
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 commentaires
Tao Cui
Tao Cui le 31 Mar 2017
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 le 31 Mar 2017
Sorry, I could not find a solution to this issue (also with R2015b).

Connectez-vous pour commenter.

Réponses (2)

Tao Cui
Tao Cui le 25 Avr 2017
Modifié(e) : Tao Cui le 25 Avr 2017
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 le 6 Juin 2017
Modifié(e) : Andrei le 7 Déc 2017
This is fixed in MATLAB R2017b.
A workaround is attached to this bug report .
  1 commentaire
Lucie S.
Lucie S. le 10 Jan 2022
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

Connectez-vous pour commenter.

Catégories

En savoir plus sur Simultaneous and Synchronized Operations dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by