Skip to content

Commit

Permalink
track memory arena memory usage
Browse files Browse the repository at this point in the history
  • Loading branch information
PSeitz committed Aug 16, 2023
1 parent 62ece86 commit c5cf819
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/aggregation/bucket/term_agg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion src/collector/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ pub fn test_filter_collector() -> crate::Result<()> {
let schema = schema_builder.build();
let index = Index::create_in_ram(schema);

let mut index_writer = index.writer_with_num_threads(1, 10_000_000)?;
let mut index_writer = index.writer_with_num_threads(1, 20_000_000)?;
index_writer.add_document(doc!(title => "The Name of the Wind", price => 30_200u64, date => DateTime::from_utc(OffsetDateTime::parse("1898-04-09T00:00:00+00:00", &Rfc3339).unwrap())))?;
index_writer.add_document(doc!(title => "The Diary of Muadib", price => 29_240u64, date => DateTime::from_utc(OffsetDateTime::parse("2020-04-09T00:00:00+00:00", &Rfc3339).unwrap())))?;
index_writer.add_document(doc!(title => "The Diary of Anne Frank", price => 18_240u64, date => DateTime::from_utc(OffsetDateTime::parse("2019-04-20T00:00:00+00:00", &Rfc3339).unwrap())))?;
Expand Down
2 changes: 1 addition & 1 deletion stacker/src/arena_hashmap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ impl ArenaHashMap {

#[inline]
pub fn mem_usage(&self) -> usize {
self.table.len() * mem::size_of::<KeyValue>()
self.table.len() * mem::size_of::<KeyValue>() + self.memory_arena.mem_usage()
}

#[inline]
Expand Down

0 comments on commit c5cf819

Please sign in to comment.