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

Utilise a Flag to Toggle With the GC #4897

Merged
merged 2 commits into from Feb 18, 2020
Merged

Utilise a Flag to Toggle With the GC #4897

merged 2 commits into from Feb 18, 2020

Conversation

nisdas
Copy link
Member

@nisdas nisdas commented Feb 17, 2020

Originally a part of #4844

This allows nodes to toggle with the percentage of newly allocated data to live data that the GC is triggered to run again.

@nisdas nisdas added the Ready For Review A pull request ready for code review label Feb 17, 2020
@nisdas nisdas mentioned this pull request Feb 18, 2020
5 tasks
@codecov
Copy link

codecov bot commented Feb 18, 2020

Codecov Report

Merging #4897 into master will increase coverage by 0.01%.
The diff coverage is 71.42%.

@@            Coverage Diff             @@
##           master    #4897      +/-   ##
==========================================
+ Coverage   47.54%   47.56%   +0.01%     
==========================================
  Files         203      204       +1     
  Lines       15288    15300      +12     
==========================================
+ Hits         7269     7277       +8     
- Misses       6879     6883       +4     
  Partials     1140     1140

@prylabs-bulldozer prylabs-bulldozer bot merged commit c7d0ced into master Feb 18, 2020
@prestonvanloon
Copy link
Member

When would someone want to change this from the default?

@nisdas
Copy link
Member Author

nisdas commented Feb 18, 2020

@prestonvanloon When they are running the node on a device with restricted amount of memory. Ex: Pi 4. Making the GC more aggressive can prevent OOMs from being triggered

@nisdas nisdas deleted the setGC branch February 18, 2020 00:46
@@ -126,6 +127,7 @@ func main() {
}
}

runtimeDebug.SetGCPercent(ctx.GlobalInt(flags.SetGCPercent.Name))
Copy link
Member

Choose a reason for hiding this comment

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

This should only be set if the flag is set, otherwise we are overriding the behavior of the environment variable

The initial setting is the value of the GOGC environment variable at startup, or 100 if the variable is not set.

cryptomental pushed a commit to cryptomental/prysm that referenced this pull request Feb 24, 2020
* set flag
* Merge refs/heads/master into setGC
cryptomental pushed a commit to cryptomental/prysm that referenced this pull request Feb 28, 2020
* set flag
* Merge refs/heads/master into setGC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ready For Review A pull request ready for code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants