fix: set M_MMAP_THRESHOLD to lower memory usage significantly
This commit is contained in:
parent
22bca8632b
commit
ec70edfff8
1 changed files with 6 additions and 0 deletions
|
|
@ -6,5 +6,11 @@ use tikv_jemallocator::Jemalloc;
|
||||||
static GLOBAL: Jemalloc = Jemalloc;
|
static GLOBAL: Jemalloc = Jemalloc;
|
||||||
|
|
||||||
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
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()
|
cosmic_files::main()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue