@@ -28,15 +28,13 @@ import (
28
28
"os"
29
29
"path/filepath"
30
30
"runtime"
31
- godebug "runtime/debug"
32
31
"strconv"
33
32
"strings"
34
33
"text/tabwriter"
35
34
"text/template"
36
35
"time"
37
36
38
37
pcsclite "github.com/gballet/go-libpcsclite"
39
- gopsutil "github.com/shirou/gopsutil/mem"
40
38
"gopkg.in/urfave/cli.v1"
41
39
42
40
"github.com/scroll-tech/go-ethereum/accounts"
@@ -1784,26 +1782,6 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) {
1784
1782
log .Info ("Shadow fork peers" , "ids" , cfg .ShadowForkPeerIDs )
1785
1783
}
1786
1784
1787
- // Cap the cache allowance and tune the garbage collector
1788
- mem , err := gopsutil .VirtualMemory ()
1789
- if err == nil {
1790
- if 32 << (^ uintptr (0 )>> 63 ) == 32 && mem .Total > 2 * 1024 * 1024 * 1024 {
1791
- log .Warn ("Lowering memory allowance on 32bit arch" , "available" , mem .Total / 1024 / 1024 , "addressable" , 2 * 1024 )
1792
- mem .Total = 2 * 1024 * 1024 * 1024
1793
- }
1794
- allowance := int (mem .Total / 1024 / 1024 / 3 )
1795
- if cache := ctx .GlobalInt (CacheFlag .Name ); cache > allowance {
1796
- log .Warn ("Sanitizing cache to Go's GC limits" , "provided" , cache , "updated" , allowance )
1797
- ctx .GlobalSet (CacheFlag .Name , strconv .Itoa (allowance ))
1798
- }
1799
- }
1800
- // Ensure Go's GC ignores the database cache for trigger percentage
1801
- cache := ctx .GlobalInt (CacheFlag .Name )
1802
- gogc := math .Max (20 , math .Min (100 , 100 / (float64 (cache )/ 1024 )))
1803
-
1804
- log .Debug ("Sanitizing Go's GC trigger" , "percent" , int (gogc ))
1805
- godebug .SetGCPercent (int (gogc ))
1806
-
1807
1785
if ctx .GlobalIsSet (SyncModeFlag .Name ) {
1808
1786
cfg .SyncMode = * GlobalTextMarshaler (ctx , SyncModeFlag .Name ).(* downloader.SyncMode )
1809
1787
}
0 commit comments