cmd/geth: handle memfixes on 32bit arch with large RAM #21028
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
If a 32bit Geth is ran on a system with a lot of RAM (e.g. AppVeyor 32bit test), Geth will bump the memory request to 4GB, which will cause an OOM since we cannot address that much. This PR adds a fine tuning so that if we're on a 32 bit platform (or rather have 32 bit pointers), then we cap the memory Geth will use accordingly.
I'm unsure what the correct value is. The theoretical max in 4GB RAM, Windows I know only allows about 3 to be used.