Merge bitcoin/bitcoin#34606: doc: clarify swapping impact on IBD performance

a61907e5d9c1988eb1e018cae5831d6b94f4da7f doc: explain swapping in `reduce-memory.md` (Lőrinc)

Pull request description:

  ### Problem
  Sustained [heavy swapping](https://en.wikipedia.org/wiki/Thrashing_(computer_science)) can grind execution to a halt, but today users get no direct warning from the node when this happens, and this caveat is not documented.

  ### Fix
  We can’t easily detect heavy swap pressure in a reliable, cross-platform way, but we can document what swapping is and why it can severely degrade IBD performance.

  ---

  Note: An earlier version of this PR attempted to detect and warn on heavy swapping (Linux-only), but it was changed to documentation based on review feedback.

ACKs for top commit:
  ajtowns:
    utACK a61907e5d9c1988eb1e018cae5831d6b94f4da7f
  sedited:
    ACK a61907e5d9c1988eb1e018cae5831d6b94f4da7f

Tree-SHA512: b21c40d07d78d890c19d3a17faad4ab4127688884dc433a1bdb63d18de07628c048227eba2f1258c6b542a71a986d4250f8abf8f8ffe0cda433ce0c8673978d4
This commit is contained in:
merge-script 2026-03-09 14:21:36 +00:00
commit d3056bc149
No known key found for this signature in database
GPG Key ID: 2EEB9F5CC09526C1

View File

@ -2,6 +2,15 @@
There are a few parameters that can be dialed down to reduce the memory usage of `bitcoind`. This can be useful on embedded systems or small VPSes.
## Swapping
When the operating system is under memory pressure, it may swap memory pages from RAM to disk.
If this becomes continuous ("thrashing"), `bitcoind` can slow to a crawl, especially during initial sync or reindex.
If you see sustained swap I/O while `bitcoind` runs, restart with a lower `-dbcache`.
If needed, also reduce `-maxmempool`, `-maxconnections`, or use `-blocksonly`.
Bitcoin Core may warn at startup when `-dbcache` looks too large for the detected system memory.
## In-memory caches
The size of some in-memory caches can be reduced. As caches trade off memory usage for performance, reducing these will usually have a negative effect on performance.