gc: set pending capacity for gc worker
@@ -54,6 +54,7 @@ const GC_LOG_DELETED_VERSION_THRESHOLD: usize = 30;
pub const GC_MAX_EXECUTING_TASKS: usize = 10;
const GC_TASK_SLOW_SECONDS: u64 = 30;
+const GC_MAX_PENDING_TASKS: usize = 4096;
/// Provides safe point.
pub trait GcSafePointProvider: Send + 'static {
@@ -790,7 +791,7 @@ where
cfg: GcConfig,
feature_gate: FeatureGate,
) -> GcWorker<E, RR> {
- let worker_builder = WorkerBuilder::new("gc-worker");
+ let worker_builder = WorkerBuilder::new("gc-worker").pending_capacity(GC_MAX_PENDING_TASKS);
let worker = worker_builder.create().lazy_build("gc-worker");
let worker_scheduler = worker.scheduler();
GcWorker {
