Skip to content

Long GC pause times caused by Array.Sort of primitive array #13730

@jkotas

Description

@jkotas

Repro:

static void Main()
{
    new Thread(() =>
    {
        var src = new int[10_000_000];
        for (;;) Array.Sort(src);
    }).Start();
    for (;;) { Console.WriteLine("GC start"); GC.Collect(); Console.WriteLine("GC end"); Thread.Sleep(1); }
}

Result: The GC takes very long time - if it finishes at all.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions