Skip to content

Memory leak #18

Description

@jbliao

Memory will increase dramatically by just execute a script and read response.
The example below will consume your memory 2MB/s, and not go down any more

func do() {

	rs := powershell.CreateRunspaceSimple()
	defer rs.Close()

	script := `
	Get-NetRoute | ConvertTo-Json
	`
	res := rs.ExecScript(script, false, nil)
	defer res.Close()

	log.Println(res.Exception.ToString())

	if len(res.Objects) > 0 {
		log.Println(len(res.Objects[0].ToString()))
	}
}

func main() {
	for {
		do()
	}
}

My application will sleep 5 minutes between every do(), and still increasing. It seams some memory not freed by GOGC

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions