This is a mirror of official site: http://jasper-net.blogspot.com/

Debugging Fragmentation in Gen0 Heap

| Monday, March 1, 2010
Sometime back we hit an issue where we were seeing fragmentation of the gen0 heap. We took a dump of the process and opened it with WinDbg to take a look at what was the cause of fragmentation. The service that we were debugging uses WCF TCP channels for communication and has thousands of requests being processed per second and is running for a long period of time.

A simple !GCHeapStat on the dump showed a large amount of free space in the gen0 was fragmented.  We let the service run over time and the fragmented free space in gen0 never got compacted.

0:025> !GCHeapStat
Heap             Gen0         Gen1         Gen2          LOH
Heap0       592496160      7333952   1124373352     21683696
Heap1       656628816          256   1109465368    194844296
Heap2          783712         2712   1121135544    323735184
Heap3       619391720     55659800   1111235208      1048960
Total      1869300408     62996720   4466209472    541312136


Free space:                                                 Percentage
Heap0       592421064           56      4403176     21258944SOH: 34% LOH: 98%
Heap1       616072608           24       117344    193533336SOH: 34% LOH: 99%
Heap2          766176           24       611576    322555320SOH:  0% LOH: 99%
Heap3       619383232           64     21280768       917864SOH: 35% LOH: 87%
Total      1828643080          168     26412864    538265464

Read more: Cache & Grid

Posted via email from jasper22's posterous

0 comments: