From 734ba5cb0a0b6cc5376f8889305835224d814252 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Mon, 17 Nov 2014 11:43:50 -0500 Subject: 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. --- src/or/or.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/or/or.h') 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 * -- cgit v1.2.3-54-g00ecf