Skip to content

Commit

Permalink
Add an empirical correction factor to memory limit
Browse files Browse the repository at this point in the history
  • Loading branch information
divergentdave committed May 17, 2020
1 parent df713d4 commit f2ff764
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/sys_limits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,5 +105,16 @@ pub fn get_memory_limit() -> u64 {
max = MAX_USIZE;
}

#[cfg(miri)]
{
// Miri has a significant memory consumption overhead. During a small
// test run, a memory amplification of ~35x was observed. Certain
// memory overheads may increase asymptotically with longer test runs,
// such as the interpreter's dead_alloc_map. Memory overhead is
// dominated by stacked borrows tags; the asymptotic behavior of this
// overhead needs further investigation.
max /= 40;
}

max
}

0 comments on commit f2ff764

Please sign in to comment.