Skip to content

Memory leak on go-ethereum 1.8.7 #16728

Closed
@vogelito

Description

@vogelito

System information

Geth version:

Geth
Version: 1.8.7-stable
Git Commit: 66432f3821badf24d526f2d9205f36c0543219de
Architecture: amd64
Protocol Versions: [63 62]
Network Id: 1
Go Version: go1.10
Operating System: linux
GOPATH=
GOROOT=/usr/local/go

OS & Version: Linux

Expected behaviour

Memory usage of go-ethereum should be stable.

Actual behaviour

Something happens which causes memory usage to increase substantially.

Steps to reproduce the behaviour

Unknown

pprof top

This wasn't hugely useful to us, but hoping it means something to the folks in here. Happy to provide additional information. This is currently happening ~1/day

# go tool pprof http://localhost:6060/debug/pprof/heap
Fetching profile over HTTP from http://localhost:6060/debug/pprof/heap
Saved profile in /root/pprof/pprof.geth.alloc_objects.alloc_space.inuse_objects.inuse_space.001.pb.gz
File: geth
Build ID: fb815f00e769fd84f7336a86cf929a66ba8ab66f
Type: inuse_space
Time: May 9, 2018 at 9:40pm (UTC)
Entering interactive mode (type "help" for commands, "o" for options)
(pprof) top
Showing nodes accounting for 5332.62MB, 84.39% of 6318.78MB total
Dropped 349 nodes (cum <= 31.59MB)
Showing top 10 nodes out of 145
      flat  flat%   sum%        cum   cum%
 1186.93MB 18.78% 18.78%  1186.93MB 18.78%  runtime.malg
  861.97MB 13.64% 32.43%   861.97MB 13.64%  github.com/ethereum/go-ethereum/vendor/github.com/syndtr/goleveldb/leveldb/util.(*BufferPool).Get
  708.04MB 11.21% 43.63%   708.04MB 11.21%  math/big.nat.setBytes
  529.06MB  8.37% 52.00%   529.06MB  8.37%  reflect.unsafe_New
  509.52MB  8.06% 60.07%  1251.55MB 19.81%  github.com/ethereum/go-ethereum/rlp.decodeBigInt
  453.14MB  7.17% 67.24%   464.65MB  7.35%  github.com/ethereum/go-ethereum/trie.(*hasher).store
     388MB  6.14% 73.38%      388MB  6.14%  github.com/ethereum/go-ethereum/vendor/github.com/syndtr/goleveldb/leveldb/memdb.New
  264.43MB  4.18% 77.56%   264.43MB  4.18%  github.com/ethereum/go-ethereum/vendor/gopkg.in/fatih/set%2ev0.(*Set).Add
  228.51MB  3.62% 81.18%   482.26MB  7.63%  github.com/ethereum/go-ethereum/eth.(*peer).SendTransactions
  203.02MB  3.21% 84.39%   203.02MB  3.21%  github.com/ethereum/go-ethereum/event.(*Feed).Send

Metrics

Last month:
screen shot 2018-05-10 at 7 17 03 pm

Last 2 months:
screen shot 2018-05-10 at 7 19 15 pm

Additional info

For reference, this host was migrated to run:
v1.8.2 on March 5
v1.8.3 on March 27
v1.8.6 on Apr 26
v1.8.6 with PR #16576 on May 1
v1.8.7 on May 4

We run our node with the following cmd line arguments --rpc --rpcapi "debug,personal,eth,web3" --targetgaslimit 1000000 --cache 2048 --gpopercentile 30 --maxpeers 25

On May 1st we added --metrics --pprof --pprofaddr=127.0.0.1 and started tracking various metrics. We thought this was the source of the problem so earlier today we restarted the node without the additional flags, but unfortunately the memory leak happened again.

This is the memory breakdown the last 48 hours:
screen shot 2018-05-10 at 7 25 28 pm

And since upgrading to 1.8.7:
screen shot 2018-05-10 at 7 26 39 pm

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions