Skip to content

os/exec: exec.command has memory leak #20980

@Durgababu

Description

@Durgababu

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

1.8.3

What operating system and processor architecture are you using (go env)?

linux

What did you do?

we are using exec.Command() method many places. And we observed that there is memory leak in each call to this. Even after running running.GC(), it is not getting freeing up.

If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.

We did memory profile using pprof package. It is showing leak in below code:
os/exec.Command(/usr/local/go/src/os/exec/exec.go:133)
os/exec.(*Cmd).start(usr/local/go/src/os/exec/exec.go:368)
os/exec.(*Cmd).start(usr/local/go/src/os/exec/exec.go:359)

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeWaitingForInfoIssue is not actionable because of missing required information, which needs to be provided.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions