kekyo / FlashCap

Independent video frame capture library on .NET/.NET Core and .NET Framework.
Apache License 2.0
203 stars 29 forks source link

How to do shrink memory when capturing from WebCam to WPF #135

Closed fiery9711 closed 7 months ago

fiery9711 commented 9 months ago

Hi everyone, I'm new user this library, thanks for all who made it. But i have problem when i use webcam and set image to WPF my program size grows up to 2-3GB RAM memory how i can solve this problem?

flat-eric147 commented 9 months ago

I use FlashCap with WPF and I don't see such behavior. Being .net, perhaps it's not doing garbage collection, you might try to trigger the garbage collector explicitly and see if the situation improves. Perhaps also share some of your code? How does the WPF sample behave?

kekyo commented 7 months ago

Related #138

This fix will pool the buffers used by PixelBuffer. Using this specification and ReferImage() may improve on situations where GC occurs continuously.