bitcoindevkit / rust-electrum-client

Bitcoin Electrum client library. Supports plaintext, TLS and Onion servers.
MIT License
78 stars 63 forks source link

Very high memory consumption (that is never freed) when running `batch_script_get_history` #90

Open da-kami opened 1 year ago

da-kami commented 1 year ago

When running batch_script_get_history on a Linux machine with processing many scripts the memory consumption is enormous and does not go down. This test showcases this behavior.

When triggering the test with 7000 scripts we see a memory consumption of about 4GB. Note that you can add a loop to re-trigger the batching to see that the memory does not get freed.

This problem could be reproduced on multiple Linux machine, but not on MacOS.

I opened this Draft PR that contains a test that we used to reproduce this behavior: #89