We are running a WinForms app on a Windows 10 IoT Enterprise LTSC build 1809 that uses WMP.dll the current installed version is 12.0.17763.1821 and it seems when a audio/video file is repeated that over time it consume more and more memory and eventually will run out of memory. Resulting crashing apps.
Other Windows Build don't seem to have this issue:
- Build
1607 LTSBwith WMP version12.0.14393.4169runs without any issue. - Build
21H1 Prowith WMP version12.0.19041.1151runs without any issue.
Unfortunately because this is a LTSC version of Windows i cannot upgrade to a newer build and also cannot install any new WindowsMediaPlayer version (and they are out there) to debug this further.
So at this moment i'm stuck in how to move forward to solve this issue. And no we cannot drop WMP ;-)
Any help/ tips are appreciated.
Have you tried explicitly freeing up the resources for the object on every "Play" event? Something like this may work:
This stores the current URL in a string, wipes out the current WMP object, collects and frees up all used resources, and then creates a new WMP object to replace the former one, and sets the URL for it to the same as the URL of the old object... theoretically.