{"id":23172,"date":"2006-11-08T19:36:00","date_gmt":"2006-11-08T19:36:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/maoni\/2006\/11\/08\/correlating-the-output-of-eeheap-gc-and-address\/"},"modified":"2021-10-04T16:34:14","modified_gmt":"2021-10-04T23:34:14","slug":"correlating-the-output-of-eeheap-gc-and-address","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/dotnet\/correlating-the-output-of-eeheap-gc-and-address\/","title":{"rendered":"Correlating the output of !eeheap -gc and !address"},"content":{"rendered":"<p><P><SPAN>!address is a very powerful debugger command. It shows you exactly what your VM space looks like. If you already got the output from the !sos.eeheap -gc command (refer to <A title=\"this article\" href=\"http:\/\/msdn.microsoft.com\/msdnmag\/issues\/06\/11\/CLRInsideOut\/default.aspx?loc=en\"><FONT color=\"#800080\">this article<\/FONT><\/A> for usage on sos), for example:<\/SPAN><\/P>\n<P><SPAN>0:003&gt; !eeheap -gc<BR>Number of GC Heaps: 1<BR>generation 0 starts at 0x01245078<BR>generation 1 starts at 0x0124100c<BR>generation 2 starts at 0x01241000<BR>ephemeral segment allocation context: (0x0125a900, 0x0125b39c)<BR>&nbsp;segment&nbsp;&nbsp;&nbsp; begin allocated&nbsp;&nbsp;&nbsp;&nbsp; size<BR>001908c0 793fe120&nbsp; 7941d8a8 0x0001f788(128904)<BR><\/SPAN><SPAN>01240000<\/SPAN><SPAN> 01241000&nbsp; 0125b39c 0x0001a39c(107420)<BR>Large object heap starts at 0x02241000<BR>&nbsp;segment&nbsp;&nbsp;&nbsp; begin allocated&nbsp;&nbsp;&nbsp;&nbsp; size<BR><\/SPAN><SPAN>02240000<\/SPAN><SPAN> 02241000&nbsp; 02243250 0x00002250(8784)<BR>Total Size&nbsp;&nbsp; 0x3bd74(245108)<BR>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<BR>GC Heap Size&nbsp;&nbsp; 0x3bd74(245108)<\/SPAN><\/P>\n<P><SPAN>you can correlate the segments with the output of !address to get a better view of them. For this specific case here&#8217;s the excerpt of the output from the !address command:<\/SPAN><\/P>\n<P><SPAN>0:003&gt; !address<BR>[omitted] <BR>&nbsp;&nbsp;&nbsp; 01232000 : 01232000 &#8211; 0000e000<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Type&nbsp;&nbsp;&nbsp;&nbsp; 00000000 <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Protect&nbsp; 00000001 PAGE_NOACCESS<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; State&nbsp;&nbsp;&nbsp; 00010000 MEM_FREE<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Usage&nbsp;&nbsp;&nbsp; RegionUsageFree<BR>&nbsp;&nbsp;&nbsp; 01240000 : <\/SPAN><SPAN>01240000<\/SPAN><SPAN> &#8211; <\/SPAN><SPAN>00052000<\/SPAN><SPAN><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Type&nbsp;&nbsp;&nbsp;&nbsp; 00020000 MEM_PRIVATE<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n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8212;&#8212;&#8212;&#8212;&#8211; Usage SUMMARY &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<BR>[omitted] <\/SPAN><\/P>\n<P><SPAN>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; State SUMMARY &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<BR>&nbsp;&nbsp;&nbsp; TotSize&nbsp;&nbsp; Pct(Tots) Usage<BR>&nbsp;&nbsp; 0275c000 : 1.92%&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : MEM_COMMIT<BR>&nbsp;&nbsp; 7b20a000 : 96.20%&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : MEM_FREE<BR>&nbsp;&nbsp; 0268a000 : 1.88%&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : MEM_RESERVE<\/SPAN><\/P>\n<P><SPAN>Largest free region: Base 03240000 &#8211; Size 73050000<\/SPAN><\/P>\n<P><SPAN>This says that the 2 segments (starting from <SPAN>01240000<\/SPAN> and <SPAN>02240000<\/SPAN>) are adjacent to each other &#8211; part of them are committed, the rest is still reserved memory. Before and after the 2 segments we got some free space there. As I mentioned below it\u2019s very unlikely that the managed heap is fragmenting the&nbsp;VM because we are good about requesting large chunks at a time and usually the OS is not bad at giving us addresses that are pretty contiguous if possible. One of the very few cases where you would see managed heap fragmenting VM is if you have temporary large object segments and GC needs to frequently acquire and release VM chunks. Those chunks could be scattered in the VM space especially considering there are other things that consume VM as well at the same time.<\/SPAN><\/P><\/p>\n","protected":false},"excerpt":{"rendered":"<p>!address is a very powerful debugger command. It shows you exactly what your VM space looks like. If you already got the output from the !sos.eeheap -gc command (refer to this article for usage on sos), for example: 0:003&gt; !eeheap -gcNumber of GC Heaps: 1generation 0 starts at 0x01245078generation 1 starts at 0x0124100cgeneration 2 starts [&hellip;]<\/p>\n","protected":false},"author":3542,"featured_media":58792,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[685],"tags":[322,3011],"class_list":["post-23172","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dotnet","tag-debugging","tag-maoniposts"],"acf":[],"blog_post_summary":"<p>!address is a very powerful debugger command. It shows you exactly what your VM space looks like. If you already got the output from the !sos.eeheap -gc command (refer to this article for usage on sos), for example: 0:003&gt; !eeheap -gcNumber of GC Heaps: 1generation 0 starts at 0x01245078generation 1 starts at 0x0124100cgeneration 2 starts [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts\/23172","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/users\/3542"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/comments?post=23172"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts\/23172\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/media\/58792"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/media?parent=23172"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/categories?post=23172"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/tags?post=23172"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}