06-29-2007 09:24 AM
06-29-2007 09:38 AM
LabVIEW memory management is fairly complex, but the most frequent reasons:
The way to get around these is to know how to create your buffer once and reuse it (for instance, using shift registers, for loops or Replace Array Subsets).
I can't think of any operation you could perform on a 30 MB file which would take that long. I would expect that it would take no more than 20-30 seconds at most.
If you can upload an example of your code, we should be able to help with more specific details.
If you want more details, you should read app note 168.
06-29-2007 09:49 AM
I have to second tst's comments and add
"... a 30 Mb file, of which there are about 200 files. "
If you mean that there are 200 files that are of size 20Mb, you are talking about 6Gig of raw data.
Windoze can barely handle 2Gig memory spaces so you will have to do this in peices.
Please post your code to allow us to be of further assistance.
Ben
06-29-2007 09:52 AM
06-29-2007 09:54 AM
06-29-2007 09:56 AM
06-29-2007 11:04 AM
If I understand the problem right, the only real problem is the parsing operations. Your ASCII file seems to contain a lot of hot air if a 30+MB file only results in 45000 data points. 😉
Parsing a file can be done in portions if there is a memory issue, but 37MB should be OK to handle in one operation. Make absolutely sure you are not creating extra data copies (e.g. don't add a string indicator for your 37MB initial string, because it would have another copy of the data). For the same reason, you might want to flatten the code out to the main diagram so you don't need to shuttle 37MB between subVIs. Make sure to do things "in place" as much as possible. Operate on the original string by moving the index point instead of e.g. splitting it after each atomic parsing operation and then continue with the "after" substring in a shift register.
I am no expert here, but I would think that the "request deallocation" feature might actually hurt you. If a subVI hangs on to its memory between calls it means that the next time you call it with an equal amount of data, it can reuse the existing allocation. If you constantly deallocate, you need to constantly reallocate at the next call! (I have never played with this, so please somebody correct me if my understanding is flawed).
How complicated is the parsing operation? Are you basically moving linearly through the file or do you need to jump all over it.
06-29-2007 11:23 AM
" ... I would think that the "request deallocation" feature might actually hurt you. If a subVI hangs on to its memory between calls it means that the next time you call it with an equal amount of data, it can reuse the existing allocation. If you constantly deallocate, you need to constantly reallocate at the next call! ..."
I'll confirm that.
The request allocation is good if you dynamically load a memory pig VI to do some work and then unload it after. I recall it only attempted to deallocate when the VI is removed from memory (at least the last time played with it).
Ben
06-29-2007
11:55 AM
- last edited on
04-27-2025
11:05 PM
by
Content Cleaner