summaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
Diffstat (limited to 'src/or')
-rw-r--r--src/or/circuitlist.c12
-rw-r--r--src/or/relay.c2
-rw-r--r--src/or/relay.h2
3 files changed, 11 insertions, 5 deletions
diff --git a/src/or/circuitlist.c b/src/or/circuitlist.c
index f074025a39..661438d8f1 100644
--- a/src/or/circuitlist.c
+++ b/src/or/circuitlist.c
@@ -2404,9 +2404,15 @@ circuits_handle_oom(size_t current_allocation)
int n_circuits_killed=0;
int n_dirconns_killed=0;
uint32_t now_ts;
- log_notice(LD_GENERAL, "We're low on memory. Killing circuits with "
- "over-long queues. (This behavior is controlled by "
- "MaxMemInQueues.)");
+ log_notice(LD_GENERAL, "We're low on memory (cell queues total alloc: %zu,"
+ " buffer total alloc: %zu, tor compress total alloc: %zu,"
+ " rendezvous cache total alloc: %zu). Killing circuits with"
+ " over-long queues. (This behavior is controlled by"
+ " MaxMemInQueues.)",
+ cell_queues_get_total_allocation(),
+ buf_get_total_allocation(),
+ tor_compress_get_total_allocation(),
+ rend_cache_get_total_allocation());
{
size_t mem_target = (size_t)(get_options()->MaxMemInQueues *
diff --git a/src/or/relay.c b/src/or/relay.c
index ac2a98e125..b1b99526df 100644
--- a/src/or/relay.c
+++ b/src/or/relay.c
@@ -2596,7 +2596,7 @@ packed_cell_mem_cost(void)
}
/* DOCDOC */
-STATIC size_t
+size_t
cell_queues_get_total_allocation(void)
{
return total_cells_allocated * packed_cell_mem_cost();
diff --git a/src/or/relay.h b/src/or/relay.h
index daf789c855..f0fa7e9870 100644
--- a/src/or/relay.h
+++ b/src/or/relay.h
@@ -17,6 +17,7 @@ extern uint64_t stats_n_relay_cells_delivered;
int circuit_receive_relay_cell(cell_t *cell, circuit_t *circ,
cell_direction_t cell_direction);
+size_t cell_queues_get_total_allocation(void);
void relay_header_pack(uint8_t *dest, const relay_header_t *src);
void relay_header_unpack(relay_header_t *dest, const uint8_t *src);
@@ -114,7 +115,6 @@ STATIC int connection_edge_process_resolved_cell(edge_connection_t *conn,
STATIC packed_cell_t *packed_cell_new(void);
STATIC packed_cell_t *cell_queue_pop(cell_queue_t *queue);
STATIC destroy_cell_t *destroy_cell_queue_pop(destroy_cell_queue_t *queue);
-STATIC size_t cell_queues_get_total_allocation(void);
STATIC int cell_queues_check_size(void);
#endif /* defined(RELAY_PRIVATE) */