DebugDiag fix for Overflow at Line 2397
DebugDiag is a free debugging tool which you can get from Microsoft. It's for debugging crashes, hangs and memory leaks.
If you've tried to use DebugDiag 1.1 (latest as of March 2009) to debug a memory leak then you may have run into this error:
A fix for that error is available below.
Installing the fix
Your existing DebugDiag dump files should be fine. You just need to select them and re-generate the analysis of them.
Details of the fix
For each memory heap in the target process DebugDiag reports two percentages: Committed / Reserved and Uncommitted / Reserved. If the Reserved value is zero -- presumably due to a heap which was created but never used -- then those calculations trigger a divide-by-zero error which VBScript reports as an overflow.
This was easy to fix because the calculations are done in some VBScript within one of the .ASP text files that are part of DebugDiag. While the error message says the problem is in on line 2397 of MemoryAnalysis.asp it's actually on line 187 of HeapFunctions.asp, which MemoryAnalysis.asp includes. (Neither file even has a line 2397; they're both much shorter. The parser appears to treat included files as if they were literally part of the top-level file, reporting all errors as coming from the top-level file and accumulating line numbers as each file is included.)
Here's a screenshot showing my changes and the source of the divide-by-zero errors:
(The tool in the screenshot is the excellent Beyond Compare.)
Check out Directory Opus, IMO the best file manager for Windows. That goes double if you're using Vista.