The following code is run (LV 2011 64-bit on Windows 7 x64 machine with 4GB memory) and causes a crash at the Array Subset - the U8 array is allocated OK.
Unfortunately LV doesn't create a crash report or offer to send it to NI, but it sometimes appears that it is an Access Violation error. Can anyone replicate, or offer suggestions on tracking the problem down?
This code has been stripped down from a much larger code, but behaves exactly the same. In the full version, the array is a large 3D image, and is read in from disk without any problems. I'm attempting to interpolate planes of pixels from this array to create cutting plane images. On the particular image I need to create, the first 440 odd pixels are interpolated ok, but with this particular set of indices for the Subset, LV immediately crashes.
I have tried the above code on another machine (XP x64 with 8GB, also LV 2011 64-bit). On this second machine, an array of this particular size cannot be allocated, although a much larger array (1000x1000x5000) can be allocated without any problems.
When I replicate your code, I simply get a 'Memory is Full" error. I get the same error for a larger array. I think your memory is just having problems finding contiguous spots for your array.
Some ideas on reducing memory use can be found here:
Thanks for the link. However I don't think it's a memory allocation issue - or it shouldn't be anyway. The program is allocating an array of less than 2.5GB on 64-bit LabVIEW on a 64-bit Windows machine, so should always be able to fit that into virtual memory, or so I would have thought. I presume that if I've initialized an array with a value, then LV has written that value to every element of that array. I can certainly access some of these values, but for the particular indices given in the code above, it crashes immediately, with no Memory Access error.
By the way, for the interpolation task I was needing to do, I've been able to split the image array into multiple sections and process them independently, although it's certainly not as easy or convenient. I had hoped that this was where 64-bit LabVIEW would be useful, but it's hardly giving me any bigger arrays than I get using the 32-bit version.
OK, I rewrote the example above to manually extract the sub-array, like this:
Doing it this way, it doesn't crash! If I use "Array Subset" as in the first post, it crashes.
So I'm guessing there's a bug in Array Subset, but it seems to only appear for "large" arrays, and only for certain indices.
Alisha - I don't get a "Memory is Full" error. Are you running this on 64-bit LabVIEW?
In any case, I don't want to reduce memory use - I need to use an array of that size, and 64-bit LabVIEW should enable me to do that.
No, I wasn't using 64-bit LabVIEW which would definitely make a huge difference. This does look suspicious - I'll see if I can find a 64-bit machine/LabVIEW and reproduce it.
Cross-posted on LAVA as a reply to another thread, with a reply from the other Greg: http://lavag.org/topic/15217-max-data-structure-sizes-queues-arrays-etc/
Yes, the LAVA thread is useful in terms of understanding memory usage, but it hasn't addressed this bug, so I'd still appreciate comments here if possible. I do, though, very much appreciate the thoughts from "the other Greg" 🙂
I reproduced the crash with 64-bit LabVIEW (although I was not able to reproduce it working with a larger array because I just got "Memory is Full" errors on the machine I had)
This was reported to R&D (CAR #326093) for further investigation. Thanks for the feedback!