init: add MALLOC_ARENA_MAX=1 to systemd #27641

pull sangaman wants to merge 1 commits into bitcoin:master from sangaman:malloc_arena_max_systemd changing 2557 files +743352 −0
  1. sangaman commented at 2:16 PM on May 12, 2023: contributor

    This adds the MALLOC_ARENA_MAX=1 environment variable as suggested in https://github.com/bitcoin/bitcoin/blob/master/doc/reduce-memory.md#linux-specific to the systemd service file definition.

    Without this env var, memory usage can grow significantly especially when rpcthreads is increased above its default value.

    Closes #24542.

    I have tested this change myself with positive results after dealing with memory consumption issues for a long time using systemd on a 8GB RAM raspi4. I figure a similar change may be desirable for the OpenRC and CentOS init files, but I don't have a way to test them and I'm not even exactly sure how environment variables should be added there (via export statements?).

  2. DrahtBot commented at 2:16 PM on May 12, 2023: member

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

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

  3. init: add MALLOC_ARENA_MAX=1 to systemd
    This adds the `MALLOC_ARENA_MAX=1` environment variable as suggested in
    https://github.com/bitcoin/bitcoin/blob/master/doc/reduce-memory.md#linux-specific
    to the systemd service file definition.
    
    Without this env var, memory usage can grow significantly especially when
    `rpcthreads` is increased above its default value.
    
    Closes #24542.
    7cbcb55d82
  4. sangaman closed this on May 12, 2023

  5. sangaman force-pushed on May 12, 2023
  6. sangaman commented at 3:16 PM on May 12, 2023: contributor

    Looks like I goofed somehow when editing my branch to remove some whitespace and that resulted in closing this PR, that's what I get for creating the original commit in the github.com text editor. Reopened in #27642.

  7. fanquake locked this on May 12, 2023

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-04-22 18:13 UTC

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