Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
Memory Leak on XamRibbon Tooltip

We have an issue in our product with ViewModels hanging around, and using dotMemory I continually see that it appears that tool tips in the ribbon are holding onto things. 

I have a sample project where I've managed to repeat the issue. The project has a simple ribbon with a few buttons. The RunRiskAnalysis button is a mock up of one of the buttons in our actual projects ribbon (with bindings and resources taken out).

Steps I take to repeat;

  1. Open the sample program, take snapshot
  2. Hover over the tooltip, take snapshot
  3. Hit the "Change DataContext" button numerous times, take snapshot

It doesn't happen 100% of the time but happens very frequently..

What I see is that when I hover over the RunRiskAnalysis button for the first time I see a jump in unmanaged memory, but I don't think this is related. After I hit the Change DataContext button a few times I see the managed memory go up and not come back down.

Comparing the first and last snapshot I can see there are two instances of my VIewModel when there should only be one.

When I investigate the surviving object I can see that it is being retained by the tool tip. Here are a couple retention paths from a couple different times repeating the issue.

Our product is using 13.1 but I've repeated in our product and in the sample using the latest (23.1)

I tried attaching the sample project but it was too big to attach. Let me know where I can send it.