From 249e316efc74f31a4e5669ea95f80c1f138edf5b Mon Sep 17 00:00:00 2001 From: Martin Vogel Date: Sat, 25 Jul 2026 17:09:31 +0200 Subject: [PATCH] wip: collect at all per-job thread exits Signed-off-by: Martin Vogel --- src/daemon/application.c | 4 ++++ src/daemon/runtime.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/daemon/application.c b/src/daemon/application.c index f1a7c673e..9085cf85a 100644 --- a/src/daemon/application.c +++ b/src/daemon/application.c @@ -1602,6 +1602,10 @@ static void *application_job_thread(void *opaque) { } } application_job_publish(job, &execution); + /* Same reasoning as the connection worker: hand this thread's allocator + * pages back while it still owns them, since abandoned pages are not + * reclaimed in practice (#581). */ + cbm_mem_collect(); return NULL; } diff --git a/src/daemon/runtime.c b/src/daemon/runtime.c index 11eb6ea76..fc3cc0b1d 100644 --- a/src/daemon/runtime.c +++ b/src/daemon/runtime.c @@ -1248,6 +1248,10 @@ static void *runtime_application_worker(void *opaque) { if (!sent && !atomic_load_explicit(&worker->disconnecting, memory_order_acquire)) { cbm_daemon_ipc_connection_interrupt(worker->connection); } + /* Same reasoning as the connection worker: hand this thread's allocator + * pages back while it still owns them, since abandoned pages are not + * reclaimed in practice (#581). */ + cbm_mem_collect(); return NULL; }