Resolving DAQmx Error -50352 "Memory Cannot Be Allocated"

Updated Oct 8, 2019

Reported In


  • NI-DAQmx

Operating System

  • Windows

Issue Details

I have a program that makes calls to the DAQmx driver and it is returning Error -50352 "Memory Cannot Be Allocated."  How can I resolve this?


Various known issues related to this error message have been corrected in a recent edition of the DAQmx driver. Please update to the latest compatible version of the DAQmx driver.

This error code can result from numerous causes:
  1. Trying to "Start" a task that has already been started. Ensure that any calls to DAQmx Start are outside of the read/write loop. Also, if using more than one DAQmx, try wiring a false constant to the autostart input terminal in LabVIEW (or passing the equivalent parameter using the C interface).
  2. Forgetting to "Clear" a task at the end of the program. If this is done, successive runs of the program may use up all of your system's memory, ultimately yielding this error. Ensure that the DAQmx Clear is included at the end of the code.
  3. When LabVIEW cannot find a large enough contiguous block of memory in your RAM to allocate as a buffer for your sample acquisition. By default, DAQmx automatically configures the AI buffer based on your sample rate, but you can use DAQmx Configure Input Buffer to manually create a smaller buffer.
    • Please see this KnowledgeBase article for more information on how DAQmx allocates buffer size
    • Note: If you create a smaller buffer, make sure that your LabVIEW application can read the samples off the buffer fast enough so that you do not encounter a buffer overflow error (Error -200279).
Some other troubleshooting steps to try:
  1. Confirm the latest version of the DAQmx Driver is installed.
  2. Confirm the DAQmx shipping example programs work properly with your device. This will help determine whether or not the issue is in the hardware or software.
  3. Try a different PCIe slot (if applicable)
  4. Ensure that your system has the latest OS updates installed. Running Windows Update Service on your machine and installing updates has been used to successfully eliminate this error in the past.