A project has been created, there are a lot of different windows in it, which are created and closed, but the memory is slowly getting fat, GC.Collect does not help. I read that a subscription to events can hold a window in memory, but overlapping all the code and finding out what the window holds is a little hardcore. Are there any methods of catching such events?
- oneOf course have. In VS2015 such tools are already built in, there is also DotMemory. Make a memory snapshot after the window is closed, look for the window class in the snapshot and find out who has a link to it. And in general, it will make it clear who exactly is eating memory, maybe not a window at all. - vitidev
- @vitidev I understand this is the start of diagnostics, I rummaged in it recently, but most likely because of inexperience I could not achieve Zen. - Dmitry Chistik
- This is the Diagnostic Tools, which appears on the right at the start of debug and shows info (I don’t know in which studio editions there are). And there it shows the memory consumption and there is a Memory Usage tab, where there is a Take Snapshort button. Make snapshots at the right moments and pick at them. By doing a few you can see the difference with the previous one - vitidev
- @vitidev, thank you, I understand, it means I was looking for the wrong instrument - Dmitry Chistik
- @vitidev grand merci, found a leak, issue it as an answer - Dmitry Chistik
|