doc: clarify that -maxmempool minimum is derived from cluster size limit #35532

pull fernandguil wants to merge 1 commits into bitcoin:master from fernandguil:doc/maxmempool-minimum changing 1 files +1 −1
  1. fernandguil commented at 3:14 AM on June 15, 2026: contributor

    doc/reduce-memory.md states that the minimum value for -maxmempool is a fixed 5. This is no longer accurate: the minimum is computed dynamically from the mempool's cluster size limit.

    In src/txmempool.cpp:

    int64_t cluster_limit_bytes = opts.limits.cluster_size_vbytes * 40;
    if (opts.max_size_bytes < 0 || (opts.max_size_bytes > 0 && opts.max_size_bytes < cluster_limit_bytes)) {
        error = strprintf(_("-maxmempool must be at least %d MB"), std::ceil(cluster_limit_bytes / 1'000'000.0));
    }
    

    With the default cluster size limit (DEFAULT_CLUSTER_SIZE_LIMIT_KVB = 101, i.e. 101,000 vbytes), this works out to 101,000 * 40 = 4.04 MB, rounded up to 5 MB — so the documented 5 is correct only by coincidence of the current defaults.

    This updates the wording to describe the actual behavior (derived from the cluster size limit, 5 MB by default) and mentions the -maxmempool must be at least N MB startup error a user will see if they set it too low.

  2. doc: clarify that -maxmempool minimum is derived from cluster size limit
    The minimum value for -maxmempool is no longer a hardcoded constant; it
    is computed from the mempool's cluster size limit
    (cluster_size_vbytes * 40, see src/txmempool.cpp), which works out to
    5 MB with default settings. Update reduce-memory.md to describe the
    actual behavior and the resulting startup error rather than stating a
    fixed "5".
    41af45cd58
  3. DrahtBot added the label Docs on Jun 15, 2026
  4. DrahtBot commented at 3:14 AM on June 15, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--006a51241073e994b41acfe9ec718e94-->

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/35532.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline for information on the review process. A summary of reviews will appear here.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  5. maflcko commented at 5:44 AM on June 15, 2026: member

    Thx, but this is too verbose. The previous docs are correct

  6. maflcko closed this on Jun 15, 2026

  7. fernandguil commented at 3:39 PM on June 15, 2026: contributor

    Got it, thanks for taking a look.

Labels

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-06-20 23:51 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me