We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cargo.toml
[package] name = "aaa" version = "0.1.0" edition = "2021" [dependencies] sled = "0.34.6" memory-stats = "1.1.0" humansize = "2.1.3"
use humansize::{format_size, DECIMAL}; fn main() { if let Some(usage) = memory_stats::memory_stats() { println!( "Current physical memory usage: {}", format_size(usage.physical_mem, DECIMAL) ); println!( "Current virtual memory usage: {}", format_size(usage.virtual_mem, DECIMAL) ); } aaaa(); if let Some(usage) = memory_stats::memory_stats() { println!( "Current physical memory usage: {}", format_size(usage.physical_mem, DECIMAL) ); println!( "Current virtual memory usage: {}", format_size(usage.virtual_mem, DECIMAL) ); } } fn aaaa() { let temp_path = "D:/aaa/"; println!("dir:{}", temp_path); // 使用 sled 创建一个数据库 let config = sled::Config::new() .path(temp_path) .cache_capacity(1_000_000) .mode(sled::Mode::LowSpace) .temporary(true); let code_db = config.open().unwrap(); drop(code_db); drop(config); }
output:
Current physical memory usage: 3.87 MB Current virtual memory usage: 851.97 kB dir:D:/aaa/ Current physical memory usage: 27.41 MB Current virtual memory usage: 23.55 MB
Why is the memory not freed when it's already drop db?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
cargo.toml
output:
Why is the memory not freed when it's already drop db?
The text was updated successfully, but these errors were encountered: