Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

USB WebCam consumes high CPU and memory usage

Hart,
 
IMAQ for USB does have a known memory-leak issue (as you can read under the Known Issues section for this driver download-- my last post contains a link). It sounds like this combined with the high CPU usage inherent to the camera is causing the issue. Unfortunately, since this is a free driver for 3rd party USB cameras we are not currently doing any further development.
 
Sorry for the inconvenience.
 
 
Pierre,
 
I'm glad to hear Sherrie was able to get the library to you. It might be helpful to post some of these examples in a new thread Smiley Happy I'm sure other users would love to see some of your examples!
--Michelle

National Instruments
0 Kudos
Message 11 of 23
(3,660 Views)

Dear Michelle_B,

I had managed to reduce the CPU usage from around 80% to 35% by reducing the image resolution. Unfortunately there still a problem with page file. The page file keep on increasing by 3MB every time the software capturing image. When the page file is maximum CPU will hang up.

Do you have ideas how to delete the page file so that the CPU will not hang up?

 

Thanks

Hart 

0 Kudos
Message 12 of 23
(3,610 Views)
Hart,
 
This could very well be linked to the memory leak already known with the IMAQ for USB driver. It is listed as follows on the download page:
 
- Opening and closing a camera session causes a small memory leak, so it is not recommended to do this repeatedly
 
I'm not sure that there is a work-around if it is part of the memory leak issue but let's try to troubleshoot a little. What are the steps/VIs you are using to create a camera session? Are you opening a session several times?
--Michelle

National Instruments
0 Kudos
Message 13 of 23
(3,597 Views)
Dear Michelle_B, Thanks for your concern. I followed exactly steps/VI as USB camera example. I am using while loop for capturing images, the loop continues until it found match. Thank you. Best regards, Hart
0 Kudos
Message 14 of 23
(3,529 Views)
hart,
 
It sounds like you've resolved the issue? I'm glad to hear this! Good luck with the rest of your application. 🙂
--Michelle

National Instruments
0 Kudos
Message 15 of 23
(3,516 Views)

Dear Michelle_B,

Actually the problem still not solve. The previous thread I tried to explain steps/VI that I am using to capture images. The only problem is as I mentioned before where page file bytes are increasing every time I capture image.

 

Thanks.

Best Regards,

Hart

0 Kudos
Message 16 of 23
(3,502 Views)
Hi hart,
 
I apologize for my confusion...as I said before this is very likely because of the memory leak issue with the IMAQ for USB driver. This driver is not officially supported. But I will take a look a little further for you.
 
Which example did you look at? Grab with Property Page, Grab or Snap?
 
Maybe you could post a screen shot of your code?
--Michelle

National Instruments
0 Kudos
Message 17 of 23
(3,488 Views)
Dear Michelle_B,
 
Herewith I attached screen shot as requested.
 
Thanks
 
Hart
Download All
0 Kudos
Message 18 of 23
(3,477 Views)

Hart,

Thank you for the post. Do you ever close the USB session - using IMAQ USB Close.vi? I was not able to tell from your larger image. If you are not closing the session, adding this VI might help. Also, do you run into the same problem running our examples? I'm curious to hear if you have this issue with all or any of our USB examples. Try your camera with these examples as there are only three: Grab, Grab with Property Page, and Snap.

--Michelle

National Instruments
0 Kudos
Message 19 of 23
(3,461 Views)
Dear Michelle_B,

I do close USB session using IMAQ USB close. I've tried with example USB Grab with property page. Same problem occured.

Thank you.

Best regards,
Hart
0 Kudos
Message 20 of 23
(3,401 Views)