Dangerous soft memory leak resulting from closing alpaca when using ollama instance
When alpaca dies, either by crash or termination, it causes the running ollama instance to be adopted by systemd --user. I am referring to it as a soft memory leak because it can still be freed via passing a signal to the running ollama instance. Alpaca will also start a new ollama instance as a child of itself, which makes the memory usage worse. I am currently not aware of anyone else experiencing this issue.
This wording is arguably bad
Alpaca will also start a new ollama instance as a child of itself, which makes the memory usage worse
I meant to say that starting new instance of alpaca will result in a new ollama instance being started as a child process. This makes the memory issue worse, especially with larger models.
I had a thought about possible solutions. Instead of ollama being a child process, start it as a daemon. If ollama doesn't have contact with alpaca after n minutes it would cause the daemon to stop. Another idea is that ollama watches the parent process to see if it has changed or not.