Table Of Contents

Storing Data with Data Value References to Manage Memory

Last Modified: January 12, 2018

Create a data value reference to store a single copy of a set of data. You can help manage memory and avoid frequent data copies that cause slower performance and out-of-memory errors by using data value references to store large data sets.

What to Use

What to Do

Create the following diagram to store, access, and operate on data using a data value reference.

Customize the gray sections for your unique programming goals.

Store any type of data in memory and return a reference to that data with a data value reference. Because the reference points to the data stored in memory, you can access the reference inside In Place Element Structures. The In Place Element Structure allows you to access and update the data without creating and maintaining multiple copies of the data in memory.
Add read and write elements to the In Place Element Structure using the Create DVR Read/Write Elements button in the Item tab and wire the data value reference to the Read Data Value Reference Element.
Use any nodes available in the context of the In Place Element Structure to operate on the data. The resulting data set must be the same data type as the data set that you originally stored in the data value reference.
The Write Data Value Reference Element places the resulting data set in the original memory space.

The data value reference does not save or maintain previous copies of the data anywhere in memory. If you want to maintain a log or history of your data, implement another data storage strategy.

Remove access to the data stored in the reference to prevent memory leakage. Delete Data Value Reference deletes the reference but leaves the stored data intact.

Recently Viewed Topics