mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-07-24 05:33:06 +00:00
Fix background_thread creation for the oversize_arena.
Bypassing background thread creation for the oversize_arena used to be an optimization since that arena had eager purging. However #2466 changed the purging policy for the oversize_arena -- specifically it switched to the default decay time when background_thread is enabled. This issue is noticable when the number of arenas is low: whenever the total # of arenas is <= 4 (which is the default max # of background threads), in which case the purging will be stalled since no background thread is created for the oversize_arena.
This commit is contained in:
@@ -430,11 +430,8 @@ arena_new_create_background_thread(tsdn_t *tsdn, unsigned ind) {
|
||||
if (ind == 0) {
|
||||
return;
|
||||
}
|
||||
/*
|
||||
* Avoid creating a new background thread just for the huge arena, which
|
||||
* purges eagerly by default.
|
||||
*/
|
||||
if (have_background_thread && !arena_is_huge(ind)) {
|
||||
|
||||
if (have_background_thread) {
|
||||
if (background_thread_create(tsdn_tsd(tsdn), ind)) {
|
||||
malloc_printf("<jemalloc>: error in background thread "
|
||||
"creation for arena %u. Abort.\n", ind);
|
||||
|
||||
Reference in New Issue
Block a user