use std::collections::{HashMap, VecDeque}; use tikv_jemallocator::Jemalloc; use unkai::UnkaiGlobalAlloc; #[global_allocator] static UNKAI: UnkaiGlobalAlloc = UnkaiGlobalAlloc::new(Jemalloc {}, 99, 5, 10, 0); fn main() { UNKAI.report_addr(); let mut container = Vec::with_capacity(10000); for _ in 0..10000 { let item = Vec::::with_capacity(1000); container.push(item); } let mut container2 = Vec::with_capacity(10000); for _ in 0..10000 { let item = HashMap::::with_capacity(1000); container2.push(item); } let mut container3 = Vec::with_capacity(10000); for _ in 0..10000 { let item = VecDeque::::with_capacity(1000); container3.push(item); } println!("{:#?}", UNKAI.report_addr()); println!(); for (bt, count) in UNKAI.report_symbol() { println!("{} bytes are allocated from:", count); println!("{}", bt); } }