aboutsummaryrefslogtreecommitdiff
path: root/src/common/mempool.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2013-06-16 09:55:44 -0400
committerNick Mathewson <nickm@torproject.org>2013-06-18 10:15:16 -0400
commit2e1fe1fcf93c2a77805048bea5c535ca4456d583 (patch)
tree6a396bc09f558b9611282de2d54a7f7824696095 /src/common/mempool.h
parent2a95f3171681ee53c97ccba9d80f4454b462aaa7 (diff)
downloadtor-2e1fe1fcf93c2a77805048bea5c535ca4456d583.tar
tor-2e1fe1fcf93c2a77805048bea5c535ca4456d583.tar.gz
Implement a real OOM-killer for too-long circuit queues.
This implements "algorithm 1" from my discussion of bug #9072: on OOM, find the circuits with the longest queues, and kill them. It's also a fix for #9063 -- without the side-effects of bug #9072. The memory bounds aren't perfect here, and you need to be sure to allow some slack for the rest of Tor's usage. This isn't a perfect fix; the rest of the solutions I describe on codeable.
Diffstat (limited to 'src/common/mempool.h')
-rw-r--r--src/common/mempool.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/common/mempool.h b/src/common/mempool.h
index d0a7bc2f3..bc424acde 100644
--- a/src/common/mempool.h
+++ b/src/common/mempool.h
@@ -22,6 +22,8 @@ void mp_pool_destroy(mp_pool_t *pool);
void mp_pool_assert_ok(mp_pool_t *pool);
void mp_pool_log_status(mp_pool_t *pool, int severity);
+#define MP_POOL_ITEM_OVERHEAD (sizeof(void*))
+
#define MEMPOOL_STATS
#ifdef MEMPOOL_PRIVATE