Skip to main content

process_rss_bytes

Function process_rss_bytes 

Source
pub fn process_rss_bytes() -> Option<u64>
Expand description

Approximate current process RSS (resident set size) in bytes.

On macOS and Linux this reads /proc/self/status (Linux) or task_info via mach (macOS-stub). Because the OxiUI facade is Pure Rust and cross-platform, this utility uses only std — it returns None on platforms where RSS cannot be determined without additional OS crates.

§Usage

Call before and after constructing an app to measure startup overhead:

let before = oxiui::process_rss_bytes();
let _app = oxiui::App::new(oxiui::AppConfig::default());
let after = oxiui::process_rss_bytes();
eprintln!("App::new() RSS delta: {} bytes", after.unwrap_or(0).saturating_sub(before.unwrap_or(0)));