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

Heap memory increased in network thread #6595

Open
twoeths opened this issue Mar 26, 2024 · 6 comments
Open

Heap memory increased in network thread #6595

twoeths opened this issue Mar 26, 2024 · 6 comments
Labels
meta-bug Issues that identify a bug and require a fix. prio-high Resolve issues as soon as possible. scope-memory Issues to reduce and improve memory usage.

Comments

@twoeths
Copy link
Contributor

twoeths commented Mar 26, 2024

Describe the bug

Memory kept increasing and then got stable. So it's similar to a leak but it did not keep increasing forever

Screenshot 2024-03-26 at 09 08 30

This does not happen on any holesky nodes, and does not happen on test mainnet node.

Expected behavior

Heap memory should be stable

Steps to reproduce

No response

Additional context

No response

Operating system

Linux

Lodestar version or commit hash

v1.17.0

@twoeths twoeths added the meta-bug Issues that identify a bug and require a fix. label Mar 26, 2024
@twoeths
Copy link
Contributor Author

twoeths commented Mar 26, 2024

network thread gc time keeps increasing along with heap memory

Screenshot 2024-03-26 at 09 16 22

gc happens randomly and if it runs right at block proposal time (when network thread need to work hard to serialize big block message) then it may cause a delay in #6596

@twoeths
Copy link
Contributor Author

twoeths commented Mar 26, 2024

it looks more like a memory leak with 100 peers in @nflaig node #6556 (comment)

@nflaig
Copy link
Member

nflaig commented Mar 26, 2024

it looks more like a memory leak with 100 peers in @nflaig node #6556 (comment)

yeah, it didn't look like it was stopping to increase on my node, still collecting data with 50 peers but will switch to 100 peers again and take some heap snapshots

@philknows philknows added prio-high Resolve issues as soon as possible. scope-memory Issues to reduce and improve memory usage. labels Mar 26, 2024
@twoeths
Copy link
Contributor Author

twoeths commented Apr 10, 2024

link to the heap snapshot #6556 (comment)

@twoeths
Copy link
Contributor Author

twoeths commented Apr 11, 2024

tracked in this libp2p issue

@twoeths
Copy link
Contributor Author

twoeths commented Apr 17, 2024

need to try @libp2p/tcp v9.0.22 which is a candidate for this issue, see libp2p/js-libp2p#2487

right now I get this error updating it

@lodestar/beacon-node: src/network/libp2p/index.ts:76:7 - error TS2322: Type '(components: TCPComponents) => Transport' is not assignable to type '(components: Components) => Transport'.
@lodestar/beacon-node:   Property '[transportSymbol]' is missing in type 'import("/Users/tuyennguyen/Projects/workshop/lodestar/packages/beacon-node/node_modules/@libp2p/interface/dist/src/transport/index").Transport' but required in type 'import("/Users/tuyennguyen/Projects/workshop/lodestar/node_modules/@libp2p/interface/dist/src/transport/index").Transport'.
@lodestar/beacon-node:  76       tcp({
@lodestar/beacon-node:           ~~~~~
@lodestar/beacon-node:  77         maxConnections: networkOpts.maxPeers,
@lodestar/beacon-node:     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@lodestar/beacon-node: ... 
@lodestar/beacon-node:  85         },
@lodestar/beacon-node:     ~~~~~~~~~~
@lodestar/beacon-node:  86       }),
@lodestar/beacon-node:     ~~~~~~~~
@lodestar/beacon-node:   ../../node_modules/@libp2p/interface/dist/src/transport/index.d.ts:53:5
@lodestar/beacon-node:     53     [transportSymbol]: true;
@lodestar/beacon-node:            ~~~~~~~~~~~~~~~~~
@lodestar/beacon-node:     '[transportSymbol]' is declared here.
@lodestar/beacon-node: Found 1 error in src/network/libp2p/index.ts:76

@wemeetagain could you help with this? 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
meta-bug Issues that identify a bug and require a fix. prio-high Resolve issues as soon as possible. scope-memory Issues to reduce and improve memory usage.
Projects
None yet
Development

No branches or pull requests

3 participants