LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW 2011 64-bit crashing with large arrays

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.

3DArrayCrash.png

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?

 

Background:

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.

0 Kudos
Message 1 of 13
(3,962 Views)

Greg,

 

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:

http://ae.natinst.com/public.nsf/web/searchinternal/c3c516c11184af3f862571b5006b46e1?OpenDocument

 

Good luck!

0 Kudos
Message 2 of 13
(3,923 Views)

I think this is the link you want, instead of the one in the previous post:

http://digital.ni.com/public.nsf/allkb/C3C516C11184AF3F862571B5006B46E1?OpenDocument

 

Chris M

0 Kudos
Message 3 of 13
(3,910 Views)

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.

0 Kudos
Message 4 of 13
(3,905 Views)

OK, I rewrote the example above to manually extract the sub-array, like this:

3DArrayNoCrash.png

Doing it this way, it doesn't crash!  If I use "Array Subset" as in the first post, it crashes.

 

To summarize:

  • 2.5GB array is allocated ok (on 64-bit LabVIEW, Windows 7 x64)
  • Extracting a 2x2x2 sub-array using "Array Subset" crashes
  • Extracting the same 2x2x2 sub-array index-by-index does not crash

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.

0 Kudos
Message 5 of 13
(3,864 Views)

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.

0 Kudos
Message 6 of 13
(3,863 Views)

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.

0 Kudos
Message 7 of 13
(3,848 Views)

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/

0 Kudos
Message 8 of 13
(3,840 Views)

@smercurio_fc wrote:

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" 🙂

0 Kudos
Message 9 of 13
(3,815 Views)

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!


0 Kudos
Message 10 of 13
(3,810 Views)