Skip to content

Why does the GC not suspend a thread doing ETW rundown? #41857

@cosminvlad

Description

@cosminvlad

Description

In a pretty large .net core 3.1 app deployed in Azure, we see large GC pauses (up to 10 seconds). Upon investigation, we have determined that the time is spent by GC in the suspend stage and the only thread that runs is one that does an ETW rundown (Azure automatically takes profiler traces from time to time). Because the app is pretty large, the rundown process takes up 10s to enumerate ~200k methods (large app, uses many libraries).

We want to understand what is so special about this thread / process that GC just waits for it and why it can't suspend it in the middle of a rundown.

Configuration

  • Which version of .NET is the code running on?
    .net core 3.1.6
  • What OS version, and what distro if applicable?
    Windows Server 2016
  • What is the architecture (x64, x86, ARM, ARM64)?
    x64

Data

GC takes >10s
image

Events like these both before and after the GC starts
image

Events DCStartVerbose and ILToNativeMapDCStart go on for 10s. Only after they stop do we find SuspendEEStop
image

Stack trace of thread doing rundown
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions