Hi everybody. By chance, I had to develop my own profiler for the CLR and came across several incomprehensible points:
- As I understand it, the
ICorProfilerCallback2::HandleCreatedevent isICorProfilerCallback2::HandleCreatedif ainitialObjectIdis generated for an object with anhandleId, and theICorProfilerCallback2::HandleDestroyedis called for a garbage collection handle if it was processed, that is, associated with The object has been deleted from memory. However, during the profiling process, I noticed that not all descriptors created by theHandleCreatedcall are calledHandleDestroyed. What could be the cause and how should this be interpreted? - When processing events,
ICorProfilerCallback::MovedReferencesnoted the following: suppose we have two ranges of addresses A ... B and C ... D. During processing, objects from the C ... D range moved to E ... F, and what was in A ... B was destroyed. However, at the next garbage collection, the GC begins to actively move the memory blocks in the range A ... B, although they have already been cleared earlier and no objects were created in this address range. Is this some kind of feature of theGCor I do not take into account something? If I do not take into account something, then what? which way to look? - And like a cherry on a cake: the objects corresponding to the range of addresses A ... B, which the
GCtrying to move so courageously, were found in the list of objects for which the garbage collection handle was not created.
All these 3 points do not allow to live in peace for the third day. Who faced similar help plizz)