The ObjectAllocatedByClass callback does not return the exact number of objects allocated (311273)
The information in this article applies to:
- Microsoft .NET Framework 1.0
- Microsoft Visual C++ 2005 Express Edition
- Microsoft Visual C++ .NET (2003)
- Microsoft Visual C++ .NET (2002)
This article was previously published under Q311273 SYMPTOMS The ObjectAllocatedByClass callback provides only an approximation of the number of objects
allocated since the most recent garbage collection (GC). That number may be
larger than, smaller than, or equal to the number of objects actually
allocated. CAUSEObjectAllocatedByClass gets the number of objects allocated since the previous GC by
walking the Gen0 heap. However, objects (for example, pinning pointers) can be
demoted and thus stay in the Gen0 heap after the previous GC. As the result,
objects may be recounted by objectAllocatedByClass. RESOLUTION To ensure that the profiler gets accurate results, you
should use the ObjectAllocated callback to count how many objects are allocated. The profiler
will get ObjectAllocated notification only when the COR_PRF_MONITOR_OBJECT_ALLOCATED and
COR_PRF_ENABLE_OBJECT_ALLOCATED event masks are set in the profiler. Note that
because of the large number of notifications fired from a typical program, this
is very costly in profiling overhead. STATUSThis
behavior is by design.
Modification Type: | Major | Last Reviewed: | 1/5/2006 |
---|
Keywords: | kbtshoot kbPerformanceTool kbprb KB311273 kbAudDeveloper |
---|
|