good morning!!!!
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
bor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
open
bor
Commits
dcc4adfc
Commit
dcc4adfc
authored
5 years ago
by
Guillaume Ballet
Committed by
Péter Szilágyi
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
cmd/geth: wrong memory size sanitizing on OpenBSD (#19793)
parent
d9c75cd1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
cmd/geth/main.go
+10
-5
10 additions, 5 deletions
cmd/geth/main.go
trie/sync_bloom.go
+1
-1
1 addition, 1 deletion
trie/sync_bloom.go
with
11 additions
and
6 deletions
cmd/geth/main.go
+
10
−
5
View file @
dcc4adfc
...
...
@@ -21,6 +21,7 @@ import (
"fmt"
"math"
"os"
"runtime"
godebug
"runtime/debug"
"sort"
"strconv"
...
...
@@ -256,11 +257,15 @@ func init() {
}
// Cap the cache allowance and tune the garbage collector
var
mem
gosigar
.
Mem
if
err
:=
mem
.
Get
();
err
==
nil
{
allowance
:=
int
(
mem
.
Total
/
1024
/
1024
/
3
)
if
cache
:=
ctx
.
GlobalInt
(
utils
.
CacheFlag
.
Name
);
cache
>
allowance
{
log
.
Warn
(
"Sanitizing cache to Go's GC limits"
,
"provided"
,
cache
,
"updated"
,
allowance
)
ctx
.
GlobalSet
(
utils
.
CacheFlag
.
Name
,
strconv
.
Itoa
(
allowance
))
// Workaround until OpenBSD support lands into gosigar
// Check https://github.com/elastic/gosigar#supported-platforms
if
runtime
.
GOOS
!=
"openbsd"
{
if
err
:=
mem
.
Get
();
err
==
nil
{
allowance
:=
int
(
mem
.
Total
/
1024
/
1024
/
3
)
if
cache
:=
ctx
.
GlobalInt
(
utils
.
CacheFlag
.
Name
);
cache
>
allowance
{
log
.
Warn
(
"Sanitizing cache to Go's GC limits"
,
"provided"
,
cache
,
"updated"
,
allowance
)
ctx
.
GlobalSet
(
utils
.
CacheFlag
.
Name
,
strconv
.
Itoa
(
allowance
))
}
}
}
// Ensure Go's GC ignores the database cache for trigger percentage
...
...
This diff is collapsed.
Click to expand it.
trie/sync_bloom.go
+
1
−
1
View file @
dcc4adfc
...
...
@@ -70,7 +70,7 @@ func NewSyncBloom(memory uint64, database ethdb.Iteratee) *SyncBloom {
// Create the bloom filter to track known trie nodes
bloom
,
err
:=
bloomfilter
.
New
(
memory
*
1024
*
1024
*
8
,
3
)
if
err
!=
nil
{
panic
(
fmt
.
Sprintf
(
"failed to create bloom: %v"
,
err
))
// Can't happen, here for sanity
panic
(
fmt
.
Sprintf
(
"failed to create bloom: %v"
,
err
))
}
log
.
Info
(
"Allocated fast sync bloom"
,
"size"
,
common
.
StorageSize
(
memory
*
1024
*
1024
))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment