You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use memory_stats::memory_stats;
use rusty_leveldb::{DB, LdbIterator, Options};
fn mem_trace(msg: &str){
if let Some(usage) = memory_stats() {
println!("Current virtual memory usage in {}: {}", msg, usage.virtual_mem);
}
}
fn iterate_over_db() {
let mut opts = Options::default();
opts.create_if_missing = false;
let mut db = DB::open("leveldb", opts).unwrap();
let mut iter = db.new_iter().unwrap();
while let Some((_, _)) = iter.next() {
}
}
fn main() {
mem_trace("Before use LDB");
iterate_over_db();
mem_trace("After use LDB");
}
and find that after iterate_over_db() allocated memory hasn't freed. For "leveldb" I use local storage Google Chrome.
The text was updated successfully, but these errors were encountered:
I write some code for testing crate:
and find that after iterate_over_db() allocated memory hasn't freed. For "leveldb" I use local storage Google Chrome.
The text was updated successfully, but these errors were encountered: