Skip to content

dotnet core v3.1/3.0 Process.Start execute shell command Memory Leak #3989

@lychee-ui

Description

@lychee-ui

dotnet core v3.1/3.0 Process.Start execute shell command Memory Leak

System: Ubuntu 18.04 / CentOS 7.6 / SUSE 15
SDK: 3.1.100

ex:

var psi = new ProcessStartInfo("dotnet");
psi.RedirectStandardOutput = true;

psi.Arguments = $"--version";
using (var proc = Process.Start(psi))
{
    var output = proc.StandardOutput.ReadToEnd();
    var version = output.Trim();

    if (!proc.HasExited)
    {
        proc.Kill();
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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