Merge pull request #789 from pop-os/malloc
fix: set M_MMAP_THRESHOLD to lower memory usage significantly
This commit is contained in:
commit
b18524e52b
1 changed files with 6 additions and 0 deletions
|
|
@ -6,5 +6,11 @@ use tikv_jemallocator::Jemalloc;
|
|||
static GLOBAL: Jemalloc = Jemalloc;
|
||||
|
||||
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
// Prevents glibc from hoarding memory via memory fragmentation.
|
||||
#[cfg(all(not(feature = "jemalloc"), target_env = "gnu"))]
|
||||
unsafe {
|
||||
libc::mallopt(libc::M_MMAP_THRESHOLD, 65536);
|
||||
}
|
||||
|
||||
cosmic_files::main()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue