mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-07-24 17:47:22 +03:00
Implement huge arena: opt.huge_threshold.
The feature allows using a dedicated arena for huge allocations. We want the addtional arena to separate huge allocation because: 1) mixing small extents with huge ones causes fragmentation over the long run (this feature reduces VM size significantly); 2) with many arenas, huge extents rarely get reused across threads; and 3) huge allocations happen way less frequently, therefore no concerns for lock contention.
This commit is contained in:
parent
77a71ef2b7
commit
94a88c26f4
8 changed files with 106 additions and 6 deletions
|
|
@ -341,6 +341,9 @@ TEST_BEGIN(test_thread_arena) {
|
|||
sz = sizeof(unsigned);
|
||||
assert_d_eq(mallctl("arenas.narenas", (void *)&narenas, &sz, NULL, 0),
|
||||
0, "Unexpected mallctl() failure");
|
||||
if (opt_huge_threshold != 0) {
|
||||
narenas--;
|
||||
}
|
||||
assert_u_eq(narenas, opt_narenas, "Number of arenas incorrect");
|
||||
|
||||
if (strcmp(opa, "disabled") == 0) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue