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:
@@ -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) {
|
||||
|
Reference in New Issue
Block a user