Turning on server GC results in some objects being missed from memory profiler results - by ahunter2007

Status : 

  Fixed<br /><br />
		This item has been fixed in the current or upcoming version of this product.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.

Sign in
to vote
ID 483764 Comments
Status Closed Workarounds
Type Bug Repros 0
Opened 8/19/2009 4:17:49 AM
Access Restriction Public


If a .NET application's configuration specifies gcServer enabled="true" and it allocates many objects on the large object heap, then not all of these objects will be reported via the ICorProfilerCallback::ObjectReferences callback.

This results in these objects being missing from the results in most profilers. The precise set of objects seems to depend on their eventual layout in memory.
Sign in to post a comment.
Posted by Microsoft on 8/25/2009 at 9:40 AM
Hello. Thanks for taking the time to write up such a complete report. That sort of thing helps considerably when we investigate these issues.

This is a known problem in CLR 2 (and thus .NET 2.0, 3.0, 3.5, 3.5 SP1). When server-mode GC is enabled on a multi-proc machine, then only one of the large object heaps will be reported by the ObjectReferences callback. The only work arounds I can offer are a) Inform your users of the bug so they have the choice of turning off server-mode GC, or b) use GetGenerationBounds (which properly gives you generational & large-object-heap boundaries for all heaps, even in server GC mode) and manually walk the live contents of the generations yourself instead of using ObjectReferences.

As you have observed, this problem is fixed in CLR 4. Unfortunately, that is the earliest release you will find with this fix.

Thanks again for your report.

Dave Broman
Posted by Microsoft on 8/20/2009 at 3:15 AM
Thank you for your feedback, We are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)