ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Strings and memory use

I am building a large string (1000-100M characters) of data which is done in a single vi and am running out of memory issues.  The problem I think is when I append small amounts of data to the large string I need 2* the amount of space of the concatinated string to do this.  is there a better way to do this? Pre allocate the required memory and insert characters?  Has anyone had similar issues?
 
Paul
Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 1 of 4
(2,901 Views)
Paul,

maybe this will be interesting for you:




hope this helps,
Norbert

Message Edited by Norbert B on 09-24-2007 08:15 AM

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 4
(2,892 Views)
Hi Paul,

this is quite common in processing large data sets in LV.

You should always pre-allocate the array (a string is "just" a special U8-array) and use "replace array elements"-function. You can also detect buffer allocations using the "show buffer allocations" in the tools->advanced menu (LV7.1).

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 4
(2,883 Views)

Thanks I figured I would have to treat it as a U8 array and handle it myself.  Would be nice if strings also had a prebuilt set of functions which worked is U8 arrays.  I will do this and see if it fixes my problems.

 

paul

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 4 of 4
(2,875 Views)