How to detect .NET WPF memory leak or GC long run?

Posted by Néstor Sánchez A. on Stack Overflow See other posts from Stack Overflow or by Néstor Sánchez A.
Published on 2012-04-06T01:29:43Z Indexed on 2012/04/06 5:29 UTC
Read the original article Hit count: 181

I have the next very strange situation and problem:

  • .NET 4.0 application for diagram editing (WPF).

  • Runs ok in my PC: 8GM RAM, 3.0GHz, i7 quad-core.

  • While creating objects (mostly diagram nodes and connectors, plus all the undo/redo information) the TaskManager show, as expected, some memory usage "jumps" (up and down).

  • These mem-usage "jumps" also remains executing AFTER user interaction ended. Maybe this is the GC cleaning/regorganizing memory?

  • To see what is going on, I've used the Ants mem profiler, but somewhat it prevents those "jumps" to happen after user interaction.

PROBLEM: It Freezes/Hangs after seconds or minutes of usage in some slow/weak laptos/netbooks of my beta testers (under 2GHz of speed and under 2GB of RAM). I was thinking of a memory leak, but...

EDIT: Also, there is the case that the memory usage grows and grows until collapse (only in slow machines).

  • In a Windows XP Mode machine (VM in Win 7) with only 512MB of RAM Assigned it works fine without mem-usage "jumps" after user interaction (no GC cleaning?!).

So, I really have a big trouble because I cannot reproduce the error, only see these strange behaviour (mem jumps), and the tool supposed to show me what is happening is hiding the problem (like the "observer's paradox").

Any ideas on what's happening and how to solve it?

© Stack Overflow or respective owner

Related posts about .NET

Related posts about wpf