Issue
I'm forced to work with JupyterLab on a Linux-server which I do not host myself. The problem is that the Jupyter-process takes a lot of memory; this has been part in several bug reports like here and here.
Anyhow, as can be anticipated from the introduction, I do not have any sudo-rights and therefore cannot restart the lab myself (at least I think that this should not be possible for me).
Whats odd in my opinion can be seen on this Screenshot taken from HTOP:
The bash command which startet the lab has a lot of subprocesses which all look like kernels I opened and closed over the entire usage-time (the server is up for a month and I opened and closed a lot of kernels; none was running when taking the picture).
Since every of these processes ends on .json
, I assume that these might be some still intact runtime parameters.
Anyhow, I don't want to resolve the memory-spilling-bug. My question is rather straight forward:
Since no kernel is running: Can I just kill all of the processes on the third level and free the memory by doing so, or might this crash the lab?
All processes on the third level look identical like on the screenshot, nothing else there.
The last part is essential since I have no possibility to restart the lab.
Solution
Luckily, I stumbled upon this website here.
Here the writer has a related problem with unreleased GPU-memory and also a lot of ipykernel_launchers
.
He solved this problem by using the proposed drastic way.
- First, display all your
ipykernel_launchers
withps -aux|grep ipykernel_launcher
(analog to the HTOP-screenshot in the question). - Kill every process one by one with
kill -9 PID1 PID2 ...
. Be sure to only kill everything in the style of (nothing else):/usr/bin/python3 -m ipykernel_launcher -f /content/.local/share/jupyter/runtime/kernel-95cb65b9-23eb-4f87-801b-d995ca30fc32.json
- Memory should be freed now and JupyterLab should be still running.
Edit:
Thanks to @EightBitTony on Unix&Linux-StackExchange I now know that there is a command to kill all processes in one step:
for pid in $(ps -ef | grep -v "awk" | awk '/ipykernel_launcher/ {print $2}'); do kill -9 $pid; done
Please be aware what you do when you do it this way!
Answered By - Markus
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.