Best way to track down a memory leak (C#) only visible on one customer's box
-
02-07-2019 - |
Question
What is the best way to track down a memory leak that is only found on one customer's test/release box, and no where else?
Solution
(This question is kinda funny, cause I am tracking a mem leak that isn't present on my machine ...)
OTHER TIPS
Try a memory profiler like ANTS Profiler.
If the user has the problem it consistently, take a stackdump and analyse in the standard way
It's either code, data or configuration.
Since you say the code is not faulty 100% of the time, I would blame configuration. Take a copy of the configuration (and optionally some data) and try to replicate the problem; you won't know you've found and fixed it without reproduction.
Finally, solve it with a memory profiler.
Here's an option: Give them a box where the leak isn't present.
Sometimes, it's not the code.
Edit: It's either the code, the data, or the configuration.
Or the .NET Framework, the OS, the drivers, IIS, or COM (automating Excel, for example), or so-on.
My assumption is that the memory leak is not reproducible except on the client's box (which the dev cannot be allowed to access for debugging).
PerfMon can be helpful (http://dotnetdebug.net/2005/06/30/perfmon-your-debugging-buddy/). There are several counters that may help narrow down what resource is leaking, and at what rate, etc.