From 09b4159396c331462733a9ef5a438d22faff6e25 Mon Sep 17 00:00:00 2001 From: Pascal Seitz Date: Wed, 16 Aug 2023 14:05:44 +0200 Subject: [PATCH] track memory arena memory usage --- src/aggregation/bucket/term_agg.rs | 1 + stacker/src/arena_hashmap.rs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/aggregation/bucket/term_agg.rs b/src/aggregation/bucket/term_agg.rs index 79db14c971..66db88f61e 100644 --- a/src/aggregation/bucket/term_agg.rs +++ b/src/aggregation/bucket/term_agg.rs @@ -1269,6 +1269,7 @@ mod tests { ]; let index = get_test_index_from_terms(false, &terms_per_segment)?; + assert_eq!(index.searchable_segments().unwrap().len(), 2); let agg_req: Aggregations = serde_json::from_value(json!({ "my_texts": { diff --git a/stacker/src/arena_hashmap.rs b/stacker/src/arena_hashmap.rs index 254be2de3d..931ae613b7 100644 --- a/stacker/src/arena_hashmap.rs +++ b/stacker/src/arena_hashmap.rs @@ -164,7 +164,7 @@ impl ArenaHashMap { #[inline] pub fn mem_usage(&self) -> usize { - self.table.len() * mem::size_of::() + self.table.len() * mem::size_of::() + self.memory_arena.mem_usage() } #[inline]