-
Notifications
You must be signed in to change notification settings - Fork 219
KernelTerminated
This page is may be helpful if you see the message: "Kernel terminated -- this might be caused by running out of memory or hitting a bug in some library (e.g., forking too many processes, trying to access invalid memory, etc.). Consider restarting or upgrading your project or running the relevant code directly in a terminal to track down the cause."
Currently the easiest way to test this is to open a terminal (+New --> Terminal) in your project, then type top
. Watch the processes listed there, especially the column labeled RES
, which stands for "resident memory". If your project has 1000MB of RAM, which is the default in CoCalc, and the sum of the RES entries is close to 1000000, then you should definitely expect a memory allocation failure soon.
You can type M
into top to make it sort processes by memory, which will help in seeing how much is used. You can also hit the space bar a lot to make it update frequently. Type q
when you are done. If you want to kill a process in top, type k
then the process id (PID), which is in the first column.
In addition to using the Terminal, you can also look in the Settings tab of your project under "Shared RAM", which will say how much is "currently" used. This is only updated once every 30s though.
You might also type smem -ntk
in a terminal to get a pretty useful breakdown of memory usage.
Currently in CoCalc, if you open a bunch of Jupyter notebooks, then they just sit there using memory. You have to explicitly kill them with top
or click "Restart" or restart your project in order for them to go away. This can be a significant problem if you are grading a dozens of assignments.
If you're hitting memory issues, and just want some more space, upgrade your project. The subscription are listed here. For example, for $7/month, you can upgrade from 1GB to 4GB, and have a lot more elbow room! If you're confused or have questionsa bout upgrading, just ask at [email protected].
It's possible, though by far the main source of trouble is lack of memory. If you suspect another problem, here are some thing to try:
Open a terminal, type e.g., anaconda3
, then copy and paste code in. Or put the code in a .py
file, then import it. CoCalc is also very good for editing .py
files directly. Does it segmentation fault or otherwise crash in a way that is very difficult for Jupyter to report? (Of course, if so, we want to know -- [email protected]).
Another thing you might try is to eliminate the CoCalc user interface to see what happens. Go to project settings and search for "Plain Jupyter Server", read the caveats, then click on that link. You'll probably have to refresh your browser once after clicking. Then navigate to your Jupyter notebook and open it. If everything always works fine here, but not in CoCalc, there is some issue specifically with the CoCalc interface. Let us know ([email protected]).
This Wiki is for CoCalc.com.
A more structured documentation is the CoCalc User Manual.
For further questions, please contact us.