Skip to content

Commit

Permalink
Fix arithmetic overflow when memory dump has too many objects. (#4928)
Browse files Browse the repository at this point in the history
I have a dump with GiB size, and has more than 200M objects, and
encountered arithmetic overflow when run `dumpheap -live -stat`.
  • Loading branch information
JJLovesLife authored Sep 13, 2024
1 parent 75867a1 commit b120f1c
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ private HashSet<ulong> CreateObjectSet()
}
else
{
Console.WriteLine($"Calculating live objects: {live.Count:n0} found - {(maxCount - todo.Count) * 100 / (float)maxCount:0.0}% complete");
Console.WriteLine($"Calculating live objects: {live.Count:n0} found - {(maxCount - todo.Count) * 100.0f / maxCount:0.0}% complete");
}

maxCount = Math.Max(maxCount, todo.Count);
Expand Down

0 comments on commit b120f1c

Please sign in to comment.