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.
3 Comments
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/279857-daq-toolbox-memory-leak#comment_361080
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/279857-daq-toolbox-memory-leak#comment_361080
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/279857-daq-toolbox-memory-leak#comment_441904
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/279857-daq-toolbox-memory-leak#comment_441904
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/279857-daq-toolbox-memory-leak#comment_441908
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/279857-daq-toolbox-memory-leak#comment_441908
Sign in to comment.