Skip to content

[bug]: Memory leak when running bitcoind backend in polling mode #8356

@litch

Description

@litch

Background

We're working on running against bitcoind backends for various reasons, and are noticing a pretty severe memory leak when running against bitcoind with rpcpolling.

I've ensured we're running bitcoin 25 (following discussion around this PR).

I've tried running a slow polling frequency (1 minute) and the leak is just slower with the longer duration. I haven't dug too deeply into the code to debug but it feels like it's just not cleaning up connections after each request.

I'll have to do some digging to get a profile if you need it, but @alexbosworth mentioned this is a (kind of) known issue and to just ping you here.

Your environment

  • version of lnd: 0.17.3

  • which operating system (uname -a on *Nix): Linux 00ea31e9-92e7-433e-a41f-032e4267b9aan-7c975b685c-lgsfk 5.4.253-167.359.amzn2.aarch64 Fix name typo in README #1 SMP Tue Aug 15 21:40:30 UTC 2023 aarch64 aarch64 aarch64 GNU/Linux

  • version of btcd, bitcoind, or other backend: bitcoind 25.1

  • any other relevant environment details

Steps to reproduce

lit.conf
lnd.bitcoin.node=bitcoind
# Bitcoind
lnd.bitcoind.rpchost=bitcoind-mainnet.bitcoind.svc.cluster.local:8332
lnd.bitcoind.rpcuser=<>
lnd.bitcoind.rpcpass=<>
lnd.bitcoind.zmqpubrawblock=
lnd.bitcoind.zmqpubrawtx=
lnd.bitcoind.rpcpolling=true
lnd.bitcoind.blockpollinginterval=5s
lnd.bitcoind.txpollinginterval=5s

Expected behaviour

Memory consumption should be stable.

Actual behaviour

Screenshot 2024-01-08 at 12 28 36 PM

Metadata

Metadata

Assignees

Labels

P1MUST be fixed or reviewedbugUnintended code behaviourperformance

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions