-
Notifications
You must be signed in to change notification settings - Fork 163
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #725 from Veykril/veykril/push-plmkuomkutky
Use jemalloc in benches with decay disabled
- Loading branch information
Showing
5 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#[cfg(all( | ||
not(target_os = "windows"), | ||
not(target_os = "openbsd"), | ||
any( | ||
target_arch = "x86_64", | ||
target_arch = "aarch64", | ||
target_arch = "powerpc64" | ||
) | ||
))] | ||
#[global_allocator] | ||
static GLOBAL: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc; | ||
|
||
// Disable decay after 10s because it can show up as *random* slow allocations | ||
// in benchmarks. We don't need purging in benchmarks because it isn't important | ||
// to give unallocated pages back to the OS. | ||
// https://jemalloc.net/jemalloc.3.html#opt.dirty_decay_ms | ||
#[cfg(all( | ||
not(target_os = "windows"), | ||
not(target_os = "openbsd"), | ||
any( | ||
target_arch = "x86_64", | ||
target_arch = "aarch64", | ||
target_arch = "powerpc64" | ||
) | ||
))] | ||
#[allow(non_upper_case_globals)] | ||
#[export_name = "_rjem_malloc_conf"] | ||
#[allow(unsafe_code)] | ||
pub static _rjem_malloc_conf: &[u8] = b"dirty_decay_ms:-1,muzzy_decay_ms:-1\0"; |