This was keeping around potentially many unused gray queue sections, or even constantly leaking in the case of many majors since every time we start a concurrent major we redirect some additional gray queue sections from main to worker thread gray queues, leading to unbounded growth. The gc thread always trims its gray queues at the end of the collection.
On graph8 this reduces memory usage by 5%. Fixes mem leak from #41995
}
static void
-worker_try_finish (void)
+worker_try_finish (WorkerData *data)
{
State old_state;
} while (!set_state (old_state, STATE_NOT_WORKING));
binary_protocol_worker_finish (sgen_timestamp (), forced_stop);
+
+ sgen_gray_object_queue_trim_free_list (&data->private_gray_queue);
}
void
sgen_thread_pool_job_enqueue (job);
preclean_job = NULL;
} else {
- worker_try_finish ();
+ worker_try_finish (data);
}
}
}