LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

camera memory leak

I have also memory leak with USB IMAQ driver. It varies with image size I use for capture. With 640x480 image I loose 4MB for each session. Looks like USB close does not work correctly.
I used grab3.vi it has the same effect, it does not help.
I use Logitech QuickCam Pro 5000 usb webcam.

Andrew
0 Kudos
Message 11 of 16
(1,558 Views)

Hi all,

I'm just wondering if anyone has addressed this memory leak problem associated with the NI-Imaq drivers for USB cameras. For the application I'm using, I need to use a USB frame grabbing device to take multiple images and the program stalls after a half an hour or so. I have Imaq dispose which is running after every loop to supposedly ensure that the memory buffer is not being filled but i still have this problem,

thank you and best regards,

Simon  

0 Kudos
Message 12 of 16
(1,447 Views)
Hi Simon,

There hasn't been any changes made to the USB driver yet.  If you look on the previous page DJ has posted a VI called Grab3.  You may want to try using that to see if that corrects the problem.  But as DJ said,  since this is not a supported driver it may be a while before this problem is corrected. If you are still seeing the problem, you may want to consider a solution using one of our supported drivers.  There is the IMAQdx driver for IEEE-1394 camera's and IMAQ for framegrabbers. 

Regards,
GG
0 Kudos
Message 13 of 16
(1,394 Views)
I'm running into the same memory leak problem as reported here and I was wondering if there were any suggestions for a work around other than the grab3 example. 
 
Unfortunately for the application I have the device being tested has the USB camera embedded in it, once I've tested the device I have to end the usb session, plug in the next device to test, and then re-start another USB session.  I'm running out of memory quickly.
 
Here is a really simplified version of what I'm doing.
 
Thanks,
David
0 Kudos
Message 14 of 16
(1,342 Views)

Hi,

I resolved the problem by using IMAQ USB Init only once on program startup.

I keep IMAQ session open all the time and do mutiple IMAQ USB Grab Acuire for mutiple product testing.

I pass IMAQ USB session variable from one VI to others.

I close IMAQ driver only when program quits.

 

Andrew

0 Kudos
Message 15 of 16
(1,331 Views)
Hey David,
 
You are using the IMAQ Create.VI inside of your loop. The IMAQ Create VI will try to allocate memory each iteration of the loop. Also, like Andrew said in his post, you should only use the IMAQ USB Init.VI when you want to use a specific camera, and the same goes for the enumerate cameras VI, the Grab Setup VI, the Stop VI, and the close session VI. Really, the only thing that should be inside of the while loop should be the IMAQ USB Grab Acquire.VI. Check out the Grab Example program that gets installed with the NI-IMAQ for USB Driver. Last, if you will be testing multiple USB cameras, by unplugging them and plugging in the one that you want, then you can put the IMAQ USB enumerate cameras and the IMAQ USB Init in your code so that when you plug in a new camera, it won't go past the enumerate cameras vi until the new camera is ready to be initialized. Then you can initialize that camera, and proceed to grabbing images from it. Be careful what you have inside of your while loops. 
 
Regards,
DJ L.
0 Kudos
Message 16 of 16
(1,314 Views)