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; }