feat: dynamically compute seed expansion based on RSS
Introduce a `peak_rss_bytes()` utility for accurate per-phase RAM measurement. Replace the genome-length heuristic with a dynamic seed expansion ratio based on actual RSS delta. Explicitly drop the `GraphDeBruijn` instance before MPHF construction to prevent resource contention and ensure proper memory management.
This commit is contained in:
@@ -119,6 +119,12 @@ use sysinfo::System;
|
||||
///
|
||||
/// On macOS, `available_memory()` can return 0 when the memory compressor
|
||||
/// inflates the page count; in that case we fall back to half of total memory.
|
||||
/// Returns the process peak RSS (high-water mark since process start).
|
||||
/// Monotonically increasing — use delta before/after a phase to measure its RAM cost.
|
||||
pub fn peak_rss_bytes() -> u64 {
|
||||
rss_to_bytes(&get_rusage())
|
||||
}
|
||||
|
||||
pub fn available_memory_bytes() -> u64 {
|
||||
let sys = System::new_all();
|
||||
let host_avail = match sys.available_memory() {
|
||||
|
||||
Reference in New Issue
Block a user