Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Memory snapshot triggers Garbage collection in dotMemory

I'm using dotMemory to profile asp.net mvc application running on IIS.

And I suspect that 'get snapshot' causes GC gen2 to run. Why? Here is the picture:

Snapshot causes gc Question is: is it normal behaivour? Why can't I get snapshot showing me all this uncollected by GC stuff? Every time I gets snapshot: memory usage falls down.

like image 437
VorobeY1326 Avatar asked Jul 31 '15 13:07

VorobeY1326


1 Answers

Yes, this is the normal behavior, because it does a full garbage collection before getting a snapshot. If you see memory usage falls down when you get a snapshot, that's a good sign.

Garbage collector cleans memory only if there is a memory stress. If you want to check for memory leaks you have to execute a full garbage collection and get a snapshot. If anything remains that's a memory leak.

Generally you should get a clean base snapshot and then another clean snapshot after you executing the functionality you want to test and then compare both snapshots.

like image 75
CharithJ Avatar answered Sep 21 '22 18:09

CharithJ