summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Færøy <ahf@torproject.org>2018-02-27 22:55:10 +0100
committerNick Mathewson <nickm@torproject.org>2018-03-20 07:47:19 -0400
commitfd36bd8971db1f22546569edb537f9777415a0d6 (patch)
tree933cb7da034317f8659dcb21e964633d7a233251
parent910422e8fae173f061d016c72eecc2015a09537e (diff)
downloadtor-fd36bd8971db1f22546569edb537f9777415a0d6.tar.gz
tor-fd36bd8971db1f22546569edb537f9777415a0d6.zip
Log information on specific compression backends in the OOM handler.
This patch adds some additional logging to circuits_handle_oom() to give us more information about which specific compression backend that is using a certain amount of memory. See: https://bugs.torproject.org/25372
-rw-r--r--changes/bug253723
-rw-r--r--src/or/circuitlist.c8
2 files changed, 11 insertions, 0 deletions
diff --git a/changes/bug25372 b/changes/bug25372
new file mode 100644
index 0000000000..4cceab3a45
--- /dev/null
+++ b/changes/bug25372
@@ -0,0 +1,3 @@
+ o Minor features (log messages):
+ - Improve log message in the out of memory handler to include information
+ about memory usage from the different compression backends. Closes ticket 25372.
diff --git a/src/or/circuitlist.c b/src/or/circuitlist.c
index 29ad9a8ee5..7bdef0b878 100644
--- a/src/or/circuitlist.c
+++ b/src/or/circuitlist.c
@@ -82,6 +82,9 @@
#include "routerlist.h"
#include "routerset.h"
#include "channelpadding.h"
+#include "compress_lzma.h"
+#include "compress_zlib.h"
+#include "compress_zstd.h"
#include "ht.h"
@@ -2476,12 +2479,17 @@ circuits_handle_oom(size_t current_allocation)
log_notice(LD_GENERAL, "We're low on memory (cell queues total alloc:"
" %"TOR_PRIuSZ" buffer total alloc: %" TOR_PRIuSZ ","
" tor compress total alloc: %" TOR_PRIuSZ
+ " (zlib: %" TOR_PRIuSZ ", zstd: %" TOR_PRIuSZ ","
+ " lzma: %" TOR_PRIuSZ "),"
" rendezvous cache total alloc: %" TOR_PRIuSZ "). Killing"
" circuits withover-long queues. (This behavior is controlled by"
" MaxMemInQueues.)",
cell_queues_get_total_allocation(),
buf_get_total_allocation(),
tor_compress_get_total_allocation(),
+ tor_zlib_get_total_allocation(),
+ tor_zstd_get_total_allocation(),
+ tor_lzma_get_total_allocation(),
rend_cache_get_total_allocation());
{