diff options
author | Nick Mathewson <nickm@torproject.org> | 2014-11-17 11:43:50 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2014-11-17 11:43:50 -0500 |
commit | 734ba5cb0a0b6cc5376f8889305835224d814252 (patch) | |
tree | 78fa73f2248c8cea20426c5d70c5811d5765de58 /src/or/or.h | |
parent | a68b90fc7af401220f11f4f9e39f08a8548a6957 (diff) | |
download | tor-734ba5cb0a0b6cc5376f8889305835224d814252.tar.gz tor-734ba5cb0a0b6cc5376f8889305835224d814252.zip |
Use smaller zlib objects when under memory pressure
We add a compression level argument to tor_zlib_new, and use it to
determine how much memory to allocate for the zlib object. We use the
existing level by default, but shift to smaller levels for small
requests when we have been over 3/4 of our memory usage in the past
half-hour.
Closes ticket 11791.
Diffstat (limited to 'src/or/or.h')
-rw-r--r-- | src/or/or.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/or/or.h b/src/or/or.h index 5ebe7bfac3..a9371f5768 100644 --- a/src/or/or.h +++ b/src/or/or.h @@ -3514,6 +3514,8 @@ typedef struct { uint64_t MaxMemInQueues_raw; uint64_t MaxMemInQueues;/**< If we have more memory than this allocated * for queues and buffers, run the OOM handler */ + /** Above this value, consider ourselves low on RAM. */ + uint64_t MaxMemInQueues_low_threshold; /** @name port booleans * |