You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When opening and connecting to a webcam device using the VideoCapture all works fine until you need to stop using the camera and dispose of the VideoCapture object.
The dispose runs fine and the managed code is removed from the heap however the private bytes remain.
If a new instance of VideoCapture device is used then the private bytes of the process increases consistently (by about 20mb or so each time).
Video Capture Disposal is the only method to stop the exclusive lock on the webcam.
using Emgu.CV;
int i = 0;
while (true)
{
using VideoCapture _webcam = new VideoCapture(0);
i++;
Console.WriteLine($"Execution {i}");
await Task.Delay(1000);
}
By execution 150 the process memory (as reported by visual studio) is circa 2gb.
Expected behavior
Memory usage to remain reasonably constant when connecting and disconnecting from webcam.
The text was updated successfully, but these errors were encountered:
i can confirm this behavior still exists, when using same code on emgucv & opencvsharp for camera access emgucv used around 8gb-10gb memory before gc hit while opencvsharp stays at 100-200mb for my project. I am using avalonia as frontend with dotnet 8.
Describe the bug
When opening and connecting to a webcam device using the VideoCapture all works fine until you need to stop using the camera and dispose of the VideoCapture object.
The dispose runs fine and the managed code is removed from the heap however the private bytes remain.
If a new instance of VideoCapture device is used then the private bytes of the process increases consistently (by about 20mb or so each time).
Video Capture Disposal is the only method to stop the exclusive lock on the webcam.
** OS / Platform **
Windows 11
** .Net version **
.Net Core 7 / 8
CPU Architecture
x86_64
** Emgu CV package used**
nuget package
Emgu.CV 4.8.1.5350
Emgu.runtime.windows.msvc.rt.x64 19.37.32825
To Reproduce
By execution 150 the process memory (as reported by visual studio) is circa 2gb.
Expected behavior
Memory usage to remain reasonably constant when connecting and disconnecting from webcam.
The text was updated successfully, but these errors were encountered: