Published on: 2015-10-23T06:41:49+00:00
On October 13, 2015, a discussion about high memory usage in Bitcoin nodes took place on the bitcoin-dev mailing list. Jonathan Toomim raised the issue of his running bitcoind processes using around 3GB of RAM, even though the mempool was under control. He restarted the process and noticed that the memory usage became more reasonable. Another user reported a similar problem with 35 GB of RSS usage, sparking speculation that CreateNewBlock() and getblocktemplate might be the cause. Tom Zander suggested accurately measuring memory usage on Linux and shared a script for this purpose.The conversation also touched upon the need to investigate possible memory leaks, caches, and fragmentation as potential causes of the high memory usage. Valgrind was mentioned as a possible tool for detecting memory leaks, although it did not provide promising results at the time. The suggestion to run bitcoind in valgrind with the --leak-check=full option for 10 minutes was given. It was also noted that leaks may not be the only explanation, as caches and fragmentation could contribute to the observed memory usage.The issue of high memory usage in Bitcoin nodes was further discussed, with suggestions to mitigate mempool growth by setting the -mintxfee flag. It was mentioned that this would be the default in future versions. Version 0.12.0 was planned to include better mempool management and more precise reporting.The email thread also included discussions about cross-posting confusion and warnings against trolling behavior. Various topics related to memory usage were touched upon, such as accurately measuring memory on Linux, investigating memory leaks, and the potential impact of caches and fragmentation.Overall, the conversation revolved around identifying the cause of high memory usage in Bitcoin nodes, exploring possible solutions, and sharing insights and experiences related to memory management in the Bitcoin ecosystem.In addition to the above discussion, there were other instances where users experienced high memory usage in running bitcoind processes, even though the mempool was under control. Restarting the processes resulted in a significant drop in memory usage. The issue seemed to occur with both Bitcoin Core 0.10.1 and Bitcoin XT 0.11B, leading to speculation about a memory leak in the minrelaytxfee code path. Users observed that their running bitcoind processes were using over 3 GB of RAM despite the mempool being under control. Accurate reporting of memory pool usage in newer versions of bitcoind reflects real memory usage.One user named odinn reported excessive memory consumption on three machines running Debian and p2pool, with two running XT and one running Core. They mentioned the resident set size of bitcoind and requested information on mempool size and total bitcoind resident set size from other users.The anomalous scaling of memory usage in bitcoin was also noted, along with concerns about the unlikely transaction size of 15 kB per transaction and an increase in the size of an unidentified file. There were requests for information on the memory usage of Task Manager for the bitcoin process.The discussions highlighted the need to investigate memory leaks, caches, and fragmentation as potential causes of high memory usage. The minrelaytxfee code path was identified as a possible source of the memory leak.
Updated on: 2023-08-01T16:36:18.332240+00:00