Skip to content

A fast file manager for Windows and macOS that never freezes: tabs, dual panes, archives as folders, Quick Look-style previews. A File Explorer and Finder alternative written in Rust.

627 B
Raw Blame
//! The process's own memory.

/// Gives the pages of this process that are not in use right now back to Windows (they come back from the standby list when touched
/// again). For a helper that waits idle between jobs, such as DirectLook between previews: Task Manager showed it holding what the
/// last preview used (issue 440).
pub fn trim_working_set() {
    use windows::Win32::System::Threading::{GetCurrentProcess, SetProcessWorkingSetSize};
    // (both sizes usize::MAX: "remove as many pages as possible", as documented)
    let _ = unsafe { SetProcessWorkingSetSize(GetCurrentProcess(), usize::MAX, usize::MAX) };
}