use std::{collections::HashMap, thread, time::Duration}; fn test_hashmap_static_str(i: i32) { let mut map: HashMap> = HashMap::new(); //let mut vec_keys_hashmap = Vec::new(); // REMOVE THIS AND TEST println!("-- Load Memory --"); for num in 0..5 { let key_hashmap = format!("{}_test_{}", num, i); println!("> HashMap insert"); map.insert(key_hashmap.clone(), vec![0; 100_000]); //println!("> Array Keys push"); //vec_keys_hashmap.push(key_hashmap); // REMOVE THIS AND TEST } thread::sleep(Duration::from_secs(5)); println!("-- end lifetime --"); } fn main() { for i in 0..2 { test_hashmap_static_str(i); thread::sleep(Duration::from_secs(5)); } println!("END"); loop { thread::sleep(Duration::from_secs(5)); } }