Skip to content

ICorProfilerCallback::ObjectsAllocatedByClass does not work anymore since dotnet 6 #63806

@ogxd

Description

@ogxd

Description

The CLR profiling API callback ICorProfilerCallback::ObjectsAllocatedByClass is not called by the CLR in dotnet 6.

Reproduction Steps

  1. Implement the ICorProfilerCallback interface
  2. Print to the console in the ObjectsAllocatedByClass callback
  3. Eventually also implement ICorProfilerCallback2 and print in the GarbageCollectionStarted callback, so that you you'll see that ObjectsAllocatedByClass is not called when GarbageCollectionStarted is.
  4. Use the COR_PRF_MONITOR_GC and COR_PRF_HIGH_MONITOR_NONE event mask 2 flags
  5. Attach to a NET 5.0 application: it works.
  6. Attach to a NET 6.0 application: it doesn't work anymore, ObjectsAllocatedByClass is not called.

Expected behavior

The ObjectsAllocatedByClass callback should be called for each garbage collection like it used to be before.

Actual behavior

The ObjectsAllocatedByClass callback is never called.

Regression?

Yes

Known Workarounds

No workaround was found

Configuration

dotnet version:

  • 6.0.101 (not working)
  • 5.0.100 (working)

OS: Windows 11 x64

Other information

Could it be due to these recent changes? @davmason
image

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions