Skip to content

How to free up memeory? #46

Closed Answered by giladgd
popconst asked this question in Q&A
Discussion options

You must be logged in to vote

@popconst Whenever there's no reference to an instance of LlamaContext or LlamaModel the garbage collector will prune the memory used by these objects on the llama.cpp side, so try to get rid of all the references you don't need anymore before you create a new instance of LlamaContext or LlamaModel.

For example, if you have a global variable that holds a LlamaModel instance, it still counts as a reference, so try to set it to null.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by giladgd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants