From 988631335a20d06497f58be0b8ba13adb4323a22 Mon Sep 17 00:00:00 2001 From: Steve Grubb Date: Sat, 11 May 2024 04:13:02 -0400 Subject: [PATCH] server : free llama_batch on exit (#7212) * [server] Cleanup a memory leak on exit There are a couple memory leaks on exit of the server. This hides others. After cleaning this up, you can see leaks on slots. But that is another patch to be sent after this. * make tab into spaces --- examples/server/server.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/server/server.cpp b/examples/server/server.cpp index 2bf4026d5..55c1d4129 100644 --- a/examples/server/server.cpp +++ b/examples/server/server.cpp @@ -673,6 +673,8 @@ struct server_context { llama_free_model(model); model = nullptr; } + + llama_batch_free(batch); } bool load_model(const gpt_params & params_) {