LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Allocated memory and freeing it

I'm using labview together with Vision. I am wondering how Labview handles memory allocated to arrays and image etc.

I know that after opening an image, it needs to be disposed to free up the memory. But if I have open multiple images, do I need to create the same number of IMAQ Dispose to free all the images?

I wrote a vi that basically runs one for loop within another (for looop>for loop>for loop>for loop). When I run this vi my computer ran out of virtual memory and the program just hanged.
0 Kudos
Message 1 of 2
(1,718 Views)
Hello Josh,

Thank you for contacting National Instruments. IMAQ create returns a reference to the location in memory where the image will be stored, refer to the IMAQ Vision Concepts Manual page 1-6 (24) for more information about how image data is stored in memory. The memory is allocated for an image when you actually specify the size of the image to be stored at that memory location or acquire an image into the buffer. You can run out of memory quickly if you call imaq create inside a loop providing a different name for each buffer and allocating memory for each image. To clear out all memory allocated for images you can call IMAQ dispose and wire a true to the "All Images?" input. I hope this helps you out.

Regards,
Nipun M
Applications Engineer
National Instruments
0 Kudos
Message 2 of 2
(1,682 Views)