Skip to content

Commit

Permalink
fixed memory leak by freeing temporary graph during session load
Browse files Browse the repository at this point in the history
  • Loading branch information
l3utterfly committed Oct 7, 2023
1 parent 88a14fc commit 9ee8aec
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions llama.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8405,6 +8405,10 @@ size_t llama_set_state_data(struct llama_context * ctx, uint8_t * src) {
ggml_graph_compute_helper(ctx->work_buffer, gf, /*n_threads*/ 1);

ggml_free(cpy_ctx);

// free our allocated graph
free(gf);
gf = NULL;
}

ctx->kv_self.head = kv_head;
Expand Down

0 comments on commit 9ee8aec

Please sign in to comment.