Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/shared: add 'off' option to setgc #201

Merged
merged 2 commits into from Feb 10, 2023
Merged

Conversation

segevda
Copy link
Contributor

@segevda segevda commented Feb 9, 2023

To stop GC completely, debug.SetGCPercentage needs to receive a negative integer. Passing a negative integer is cumbersome: $ gops setgc -- -1

This commit adds a more user-friendly way to achieve that: $ gops setgc off

This behavior is aligned with that of the GOGC env variable, where negative or "off" can be set to stop the GC.

fixes #200

To stop GC completely, debug.SetGCPercentage needs to receive a negative
integer. Passing a negative integer is cumbersome:
$ gops setgc <pid> -- -1

This commit adds a more user-friendly way to achieve that:
$ gops setgc <pid> off

This behavior is aligned with that of the GOGC env variable, where
negative or "off" can be set to stop the GC.
Copy link
Collaborator

@tklauser tklauser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@tklauser tklauser merged commit dbeb29c into google:master Feb 10, 2023
@segevda segevda deleted the setgc_off branch February 10, 2023 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Turning off the GC via setgc is cumbersome
2 participants