diff options
author | Alexander Færøy <ahf@torproject.org> | 2018-04-03 18:26:52 +0200 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-04-12 11:14:16 -0400 |
commit | 31508a0abccfee1cda0869a9a7d22df74d6b67b7 (patch) | |
tree | 23bcbefc8feee360572afb096051091c31817e3e /src/or/config.h | |
parent | 5633a633796ca10e2866ff6fd5bc40b5f7895c30 (diff) | |
download | tor-31508a0abccfee1cda0869a9a7d22df74d6b67b7.tar.gz tor-31508a0abccfee1cda0869a9a7d22df74d6b67b7.zip |
Use less memory for MaxMemInQueues for machines with more than 8 GB of RAM.
This patch changes the algorithm of compute_real_max_mem_in_queues() to
use 0.4 * RAM iff the system has more than or equal to 8 GB of RAM, but
will continue to use the old value of 0.75 * RAM if the system have less
than * GB of RAM available.
This patch also adds tests for compute_real_max_mem_in_queues().
See: https://bugs.torproject.org/24782
Diffstat (limited to 'src/or/config.h')
-rw-r--r-- | src/or/config.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/or/config.h b/src/or/config.h index f6a659d0c6..1d3c27217e 100644 --- a/src/or/config.h +++ b/src/or/config.h @@ -22,6 +22,13 @@ * expose more information than we're comfortable with. */ #define MIN_HEARTBEAT_PERIOD (30*60) +/** Maximum default value for MaxMemInQueues, in bytes. */ +#if SIZEOF_VOID_P >= 8 +#define MAX_DEFAULT_MEMORY_QUEUE_SIZE (U64_LITERAL(8) << 30) +#else +#define MAX_DEFAULT_MEMORY_QUEUE_SIZE (U64_LITERAL(2) << 30) +#endif + MOCK_DECL(const char*, get_dirportfrontpage, (void)); MOCK_DECL(const or_options_t *, get_options, (void)); MOCK_DECL(or_options_t *, get_options_mutable, (void)); |