Flyleaf
Flyleaf copied to clipboard
Possible handle leak when repeatedly create/play/stop/dispose flyleaf players
I am using FlyleafLib.Controls.WPF 1.3.8 via nuget on .NET 8.
I have written a WPF app that repeatedly creates/plays/stops/disposes flyleaf players. Over time, the process seems to leak handles as shown in Performance Monitor:
I have made the code available in the github repo FlyleafCycleTest
Can you replicate the handle leak or is it particular to my system?
+Up
we are also seeing memory leaks on our side. @SuRGeoNix
I will review this in the weekend
hi @SuRGeoNix were you able to take a look into this?
@dev991301 does this happen with trace log off? I cannot reproduce it so far (can you use the release's ffmpeg libraries?)
@dev991301 does this happen with trace log off? I cannot reproduce it so far (can you use the release's ffmpeg libraries?)
@SuRGeoNix It does seem to happen with trace off. I am using the FFmpeg libraries that come from the Flyleaf 3.7.16 release. It also doesn't seem to matter if video acceleration is enabled or disabled.
In the Github code I submitted, would you be able to uncomment the other players in MainWindow.xaml and see what the handle count trend looks like?
Here my results with 9 players:-
(Stable RAM/VRAM/GPU usage/Handles)
with Video Acceleration off
@SuRGeoNix did you leave it running for a long period of time?
@t3therdev about 30'
Guys, any news with this one? I couldn't reproduce it also in systems with different GPUs.
I think the handle growth on my machines may be related to the version of the integrated Intel graphics drivers I am using. Running with an old version of a graphics driver the handles didn't grow (version 27.20.100.9079 which came from HP) but when upgraded to a newer Intel driver it did grow (version 31.0.101.5382). It also grew on a machine running Intel UHD graphics around version 31.0.x.x vintage. But it didn't grow when running off the NVIDIA graphics.
Everything points to GPU / drivers so I'm not sure if there is anything left from Flyleaf side to fix. I had different issues with RX 580 and had to use older drivers to make it work properly. So I'm afraid I will close this as is not related to the library.
Possible related WPF issue here dotnet/wpf/issues/7704
It would be interested to see if the problematic GPU/drivers having the same issue with WinForms.
Update: Seems that Config.Decoder.ZeroCopy = FlyleafLib.ZeroCopy.Enabled; could be a workaround.