wip: collect at store release now that pages are mimalloc's

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
This commit is contained in:
Martin Vogel
2026-07-25 15:07:00 +02:00
parent 30327de46f
commit 063d312698
+7
View File
@@ -10419,6 +10419,13 @@ static void release_request_store(cbm_mcp_server_t *srv) {
srv->store = NULL;
free(srv->current_project);
srv->current_project = NULL;
/* The close above frees a connection's worth of page cache. Ask the
* allocator to hand those pages back now, which keeps a long-lived daemon
* flat across thousands of request-scoped stores (#581). This only became
* meaningful once the Windows interposer made the pages mimalloc's: an
* earlier attempt aimed at the CRT heap instead and could not release
* them. POSIX already purges on free, so this is a no-op there. */
cbm_mem_collect();
}
char *cbm_mcp_handle_tool(cbm_mcp_server_t *srv, const char *tool_name, const char *args_json) {