ScreenRecorderLib icon indicating copy to clipboard operation
ScreenRecorderLib copied to clipboard

Memory Leak in TestAppWinForms

Open peder2key opened this issue 2 years ago • 5 comments

Hello

I am testing the TestAppWinforms and just by looking at the visual studio diagnostic tool it looks like the app i leaking memory:

The app starts at 26mb and after starting and stopping recording for 5-6 times it goes up all the way to 1.5gb. Any tips?

Snag_12877198

peder2key avatar Nov 13 '22 18:11 peder2key

I'm able to reproduce the same thing when using software encoding. For some reason, the MF h264 software encoder does not work properly when called from Winforms, and giving no errors. It's quite strange, because the exact same code works on tests, WPF or console apps.

sskodje avatar Nov 17 '22 12:11 sskodje

Interesting. I don't have the problem with memory leaking in the WPF app. But I got a exception when I stopped recording with the winforms app. But not sure if that a clue or not:

image

peder2key avatar Nov 18 '22 07:11 peder2key

Hello, I have the same problem. But I am developing with WPF.. Visual Studio : 2019 ScreenRecordLib : 5.1.4

When I call Recorder.Record, my memory jumps. And calling Recorder.Stop doesn't decrease memory (Even if I call dispose)

godute avatar Dec 05 '22 06:12 godute

I dont know if this is any help, but I downgraded the nuget package to 5.1.0 and the memory leak was not there anymore.

peder2key avatar Dec 05 '22 10:12 peder2key

That's helpful, as i can see what's changed since then. 👍

sskodje avatar Dec 06 '22 14:12 sskodje

wow in my case, I solved at 3.2.0. thank you image

godute avatar Dec 07 '22 05:12 godute

Fixed with 4423c27e1df1e0a92beb9d0c0f8b472dcf94cabb

sskodje avatar Feb 04 '23 00:02 sskodje