Skip to content

Regression: Memory leak when launching child processes #36661

@myrup

Description

@myrup

A memory leak surfaced after upgrading our clients from .Net core 2.2 to 3.1. I've narrowed it (hopefully the only one) down with this example to have happened between 2.2 and 3.0:

for (int i = 0; i < int.MaxValue; i++) 
{
   using (var process = Process.Start("ls"))
       Console.WriteLine(i);
}

The above is memory stable targeting 2.2 but leaks on 3.0 and 3.1. Although it looks silly, I would consider it serious as it breaks any long running processes that cycle child processes.

Upon fixing, resources like process pipes should also be considered (see #24476).

Configuration

Tested against 3.1.202 on macOS 10.15.3 (19D76) and linux-arm Raspbian GNU/Linux 8 (jessie)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions