diff options
| author | Christopher Ferris <cferris@google.com> | 2018-10-19 16:03:44 -0700 |
|---|---|---|
| committer | Christopher Ferris <cferris@google.com> | 2018-11-13 10:32:33 -0800 |
| commit | d73a49e91e373cbcf4d044ec79ee7ed7b56dd7ca (patch) | |
| tree | e488c86e6ded1b98a04479aab7123c770bc4f0fd /libc/bionic/jemalloc_wrapper.cpp | |
| parent | b87e85aac399414aeacdc372df4f6900760c7aee (diff) | |
Move to jemalloc5.
Bug: 62621531
Test: Builds and boots. All unit tests pass.
Change-Id: I09d106cc3b658885b9155d6838f8df61498d3f85
Diffstat (limited to 'libc/bionic/jemalloc_wrapper.cpp')
| -rw-r--r-- | libc/bionic/jemalloc_wrapper.cpp | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/libc/bionic/jemalloc_wrapper.cpp b/libc/bionic/jemalloc_wrapper.cpp index 40f2a66c1..ef0d38438 100644 --- a/libc/bionic/jemalloc_wrapper.cpp +++ b/libc/bionic/jemalloc_wrapper.cpp @@ -52,11 +52,11 @@ int je_mallopt(int param, int value) { // The only parameter we currently understand is M_DECAY_TIME. if (param == M_DECAY_TIME) { // Only support setting the value to 1 or 0. - ssize_t decay_time; + ssize_t decay_time_ms; if (value) { - decay_time = 1; + decay_time_ms = 1000; } else { - decay_time = 0; + decay_time_ms = 0; } // First get the total number of arenas. unsigned narenas; @@ -66,15 +66,22 @@ int je_mallopt(int param, int value) { } // Set the decay time for any arenas that will be created in the future. - if (je_mallctl("arenas.decay_time", nullptr, nullptr, &decay_time, sizeof(decay_time)) != 0) { + if (je_mallctl("arenas.dirty_decay_ms", nullptr, nullptr, &decay_time_ms, sizeof(decay_time_ms)) != 0) { + return 0; + } + if (je_mallctl("arenas.muzzy_decay_ms", nullptr, nullptr, &decay_time_ms, sizeof(decay_time_ms)) != 0) { return 0; } // Change the decay on the already existing arenas. char buffer[100]; for (unsigned i = 0; i < narenas; i++) { - snprintf(buffer, sizeof(buffer), "arena.%d.decay_time", i); - if (je_mallctl(buffer, nullptr, nullptr, &decay_time, sizeof(decay_time)) != 0) { + snprintf(buffer, sizeof(buffer), "arena.%d.dirty_decay_ms", i); + if (je_mallctl(buffer, nullptr, nullptr, &decay_time_ms, sizeof(decay_time_ms)) != 0) { + break; + } + snprintf(buffer, sizeof(buffer), "arena.%d.muzzy_decay_ms", i); + if (je_mallctl(buffer, nullptr, nullptr, &decay_time_ms, sizeof(decay_time_ms)) != 0) { break; } } |
