keep-network / keep-core

The smart contracts and reference client behind the Keep network
https://keep.network
MIT License
118 stars 73 forks source link

Constant increase in memory usage #3739

Closed thevops closed 6 months ago

thevops commented 9 months ago

I've noticed that my nodes take more and more memory over time.

Please, take a look at the chart below. It shows 120 days back to now. A memory unit is MiB. image

Restarts, including version upgrades, cause spikes (eg. 09/21 = 21 Sep).

lukasz-zimnoch commented 6 months ago

Hey @thevops! Thanks for this report!

We investigated that issue and executed some profiling. We detected a goroutine leak in the GetLatestBlockHeight function of our Electrum client implementation (specifically, in the go-electrum's SubscribeHeaders function used under the hood) that is periodically called from within the client info module (metrics and diagnostics):

goroutine-leak

We opened the following PRs that should fix the problem:

Once they are merged, this issue will close automatically. Feel free to re-open if the problem persists.