Native memory leak

Hong 1,141 Reputation points
2024-05-10T02:59:31.36+00:00

I am trying to debug the memory leak of a UWP app. The memory profiling seems to suggest the leak is primarily on the native side:

User's image

I cannot make any sense of the native memory data:

Snag_3174f9b7 User's image

Could anyone offer a tip on how to read these native memory data to find a clue about the leak?

I think the leak is related to the use of MediaPlayerElement.

Universal Windows Platform (UWP)
{count} votes

1 answer

Sort by: Most helpful
  1. Hong 1,141 Reputation points
    2024-05-16T03:28:42.87+00:00

    Hi Junjie,

    Thank you for all the help.

    I think I have at least found the culprit for the memory leak that I can reproduce on my testing PC. It is related to the handling of MeidStreamSource's events such as Closed, Paused, Starting. The app missed some subscriptions (e.g., it subscribed to 5 events but unsubscribed to only 3). I did not know this could cause so much memory leak despite all the objects being disposed of.

    1 person found this answer helpful.
    0 comments No comments