Fix memory issue during chainstate initialization on 2GB box #31575

pull SecondPort wants to merge 1 commits into bitcoin:master from SecondPort:fix-memory-issue-1 changing 3 files +18 −2
  1. SecondPort commented at 6:58 pm on December 27, 2024: none

    Fixes #31573

    Reduce memory usage during chainstate initialization on low-memory systems.

    • src/txdb.h
      • Reduce the default dbcache value to 100 MiB.
    • src/validation.h
      • Add a function to adjust dbcache to 100 MiB if the system has less than 4GB of RAM.
    • doc/reduce-memory.md
      • Update the documentation to reflect the new default dbcache value.
      • Add information about the memory check for systems with less than 4GB of RAM.
  2. Fix memory issue during chainstate initialization on 2GB box
    Fixes #31573
    
    Reduce memory usage during chainstate initialization on low-memory systems.
    
    * **src/txdb.h**
      - Reduce the default `dbcache` value to 100 MiB.
    * **src/validation.h**
      - Add a function to adjust `dbcache` to 100 MiB if the system has less than 4GB of RAM.
    * **doc/reduce-memory.md**
      - Update the documentation to reflect the new default `dbcache` value.
      - Add information about the memory check for systems with less than 4GB of RAM.
    60369ab83f
  3. DrahtBot commented at 6:58 pm on December 27, 2024: contributor

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

    Code Coverage & Benchmarks

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

    Reviews

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

  4. DrahtBot added the label CI failed on Dec 27, 2024
  5. DrahtBot commented at 7:01 pm on December 27, 2024: contributor

    🚧 At least one of the CI tasks failed. Debug: https://github.com/bitcoin/bitcoin/runs/34924060853

    Try to run the tests locally, according to the documentation. However, a CI failure may still happen due to a number of reasons, for example:

    • Possibly due to a silent merge conflict (the changes in this pull request being incompatible with the current code in the target branch). If so, make sure to rebase on the latest commit of the target branch.

    • A sanitizer issue, which can only be found by compiling with the sanitizer and running the affected test.

    • An intermittent issue.

    Leave a comment here, if you need help tracking down a confusing failure.

  6. l0rinc commented at 7:02 pm on December 27, 2024: contributor

    GetTotalSystemMemory’ was not declared in this scope

    Please compile it locally before pushing.

  7. in src/validation.h:1358 in 60369ab83f
    1351@@ -1352,4 +1352,19 @@ bool IsBIP30Repeat(const CBlockIndex& block_index);
    1352 /** Identifies blocks which coinbase output was subsequently overwritten in the UTXO set (see BIP30) */
    1353 bool IsBIP30Unspendable(const CBlockIndex& block_index);
    1354 
    1355+/**
    1356+ * Check if the system has less than 4GB of RAM and adjust dbcache if necessary.
    1357+ */
    1358+void AdjustDbCacheForLowMemory(int64_t& nDefaultDbCache)
    


    daniel1302 commented at 11:59 pm on December 27, 2024:
    This function is declared but it looks unused in entire codebase.
  8. SecondPort closed this on Dec 28, 2024


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: 2025-01-21 06:12 UTC

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