‎06-25-2026 11:51 PM
I've run into a memory leak in NI-DAQmx and wanted to report it in case it's useful.
Setup
- NI-DAQmx version: 26.3.1
- OS: Windows 11 (64-bit)
- Hardware: reproduces on several multifunction USB devices (e.g. USB-6008, USB-6000, USB-6421, USB-6423)
What I'm doing
I'm working on a small data-logging project where I continuously acquire analog input, and my app repeatedly starts and stops acquisition over a long session. To narrow it down I reduced it to a minimal
loop:
1. Create a task
2. Add an analog input voltage channel
3. Configure sample clock timing (continuous samples)
4. Register an EveryNSamplesEvent callback (DAQmxRegisterEveryNSamplesEvent, Acquired Into Buffer)
5. Start the task
6. Let it run briefly
7. Stop the task
8. Deregister the callback (register with NULL)
9. Clear the task
Repeating this loop, the process memory grows by a small, fixed amount on every iteration — a steady linear climb, not a one-time bump. Over a long-running session this adds up.
Where it seems to come from
Profiling the allocations, the leaked blocks trace back into the driver during task teardown — specifically the destruction of the every-N-samples event handling (an internal
EveryNSamplesEventSupervisor-type object). The allocation originates inside the driver DLLs (nidmxfu.dll / nipalu.dll) on the path from DAQmxClearTask → event supervisor destructor. It looks like the
teardown allocates a small block (~80 bytes) that's never freed.
Notes
- The growth is perfectly linear with iteration count, which is what made me confident it's a genuine leak rather than caching or noise.
- It only occurs when an EveryNSamplesEvent callback has been registered; loops without the callback don't show it.
- Each leaked block is small, but for an app that starts/stops acquisition continuously it accumulates over time.
‎06-26-2026 12:02 PM
I have also seen this issue with an older version of DAQmx. Thanks for the confirmation.
‎06-26-2026 12:48 PM
Can you please rerport this as bug? I tried reporting but the site is broken. Also can you confirm that its also ocurring in 2026 Q2 version
‎06-26-2026 12:55 PM
I will try to report it to some NI Reps that I know. I have not yet installed DAQmx 2026Q2 and I am not sure when I will install. Sorry.
‎06-30-2026 01:57 PM
Hi BhaTTa, +1 kudos for the excellent troubleshooting. Please report it as a bug by following the steps detailed at: Report an NI Software Bug. (hopefully the site works for you this time)
If it doesn't, please join the public LabVIEW Discord Server, and copy-paste your original post into the "general-software", "general-hardware", or "daq" channels. A link to this server exists at the top of this excellent LabVIEW Wiki page.
This may help towards this being recorded as a bug and later fixed, which will benefit everybody.
‎06-30-2026 11:47 PM
Report a bug is still down, here is my understanding of the area of leak
Here's why the destructor of the EveryN-samples supervisor is the suspected leak point, in a few lines:
- When DAQmxStartTask arms the EveryN callback, NI internally allocates a tEveryNSamplesEventSupervisor object (the ~64B + ~80B
heap pair) to watch the running acquisition and fire your callback.
- When you deregister via RegisterEveryNSamplesEvent(..., NULL, NULL) and re-register before the next StartTask, that supervisor
should be torn down in its destructor and its memory freed — but it isn't; a fresh supervisor is allocated on the next StartTask
and the old one is orphaned.
- The orphaned objects are only reclaimed at DAQmxClearTask, which is why the count rises dead-linearly (1×64B + 1×80B per
iteration) on a reused task and drops to zero only when the task is cleared.
- The ablation confirms this: the leak appears only when a StartTask follows a deregister/re-register — i.e., exactly the path
that should be destroying the prior supervisor and constructing a new one — so the destructor's cleanup of that supervisor is the
most likely culprit.
‎07-03-2026 12:47 AM
Hey, can you please tell me what was the issue that you had faced, which version of NIDAQmx was it?