Data Acquisition Toolbox    

Memory Allocation

When data is acquired from an analog input subsystem or output to an analog output subsystem, it must be temporarily stored in computer memory.

The Data Acquisition Toolbox allocates memory in terms of data blocks. A data block is defined as the smallest "slice" of memory that the data acquisition engine can usefully manipulate. For example, acquired data is logged to a disk file using an integral number of data blocks. A representation of allocated memory using n data blocks is shown below.

The Data Acquisition Toolbox strives to make memory allocation as simple as possible. For this reason, the data block size and number of blocks are automatically calculated by the engine. This calculation is based on the parameters of your acquisition such as the sampling rate, and is meant to apply to most common data acquisition applications. Additionally, as data is acquired, the number of blocks dynamically increases up to a predetermined limit. However, the engine cannot guarantee that the appropriate block size, number of blocks, or total memory is allocated under these conditions:

You are free to override the memory allocation rules used by the engine and manually change the block size and number of blocks, provided the device object is not running. However, you should do so only after careful consideration, as system performance might be adversely affected, which can result in lost data.

You can manage memory resources using the BufferingConfig property and the daqmem function. With BufferingConfig, you can configure and return the block size and number of blocks used by a device object. With daqmem, you can return the current state of the memory resources used by a device object, and configure the maximum memory that one or more device objects can use.


  Managing Your Memory Resources How Much Memory Do You Need?