Skip to content

Commit

Permalink
Merge bitcoin/bitcoin#28512: doc: Be vague instead of wrong about MAL…
Browse files Browse the repository at this point in the history
…LOC_ARENA_MAX

12f7257 doc: Be vague instead of wrong about MALLOC_ARENA_MAX (Tim Ruffing)

Pull request description:

  Before this commit, we claim that glibc's malloc implementation uses 2 arenas by default. But that's true only on 32-bit systems, and even there, it uses *up* to 2 arenas.

  This commit fixes the wrong statement. The new statement is intentionally vague to reduce our maintenance burden.

  For details, see:
  https://www.gnu.org/software/libc/manual/html_node/Memory-Allocation-Tunables.html#index-glibc_002emalloc_002earena_005fmax

  Noticed in:
  bitcoin/bitcoin#27642 (comment)

ACKs for top commit:
  fanquake:
    ACK 12f7257

Tree-SHA512: c0ff1e35b682a841e366a1cad26e18ff79a93d97103529be35a972c7dcbb95f5354e7a7b98a86731f491434d64685bb58cc3cc9100f0577d8f75db05e951b09a
  • Loading branch information
fanquake committed Sep 24, 2023
2 parents ac9fa6e + 12f7257 commit dcfbf3c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion doc/reduce-memory.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ threads take up 8MiB for the thread stack on a 64-bit system, and 4MiB in a

## Linux specific

By default, glibc will create up to two heap arenas per core. This is known to cause excessive memory usage in some scenarios. To avoid this make a script that sets `MALLOC_ARENA_MAX` before starting bitcoind:
By default, glibc's implementation of `malloc` may use more than one arena. This is known to cause excessive memory usage in some scenarios. To avoid this, make a script that sets `MALLOC_ARENA_MAX` before starting bitcoind:

```bash
#!/usr/bin/env bash
Expand Down

0 comments on commit dcfbf3c

Please sign in to comment.