Stray Julia Processes

I use Julia through Jupyter notebooks on MacOS Catalina (10.15.7). My “activity monitor app” (See screenshot here ) claims I have a TON of Julia stray processes eating up many GB of RAM. Why is this? What am I doing wrong?

1 Like

Are you by any chance using Distributed and adding processors? i.e. addprocs()?

Are you by any chance using Distributed and adding processors? i.e. addprocs() ?

No.

How many notebooks did you have open when you took that screenshot? Had you killed/restarted the kernel recently?

None. When I took the screen shot, I had closed every window on my computer and quit almost all running applications. The Julia processes were hidden from sight. I suspect they have somehow been building up over the past few days/weeks.

1 Like

Did you shutdown the kernels before closing the browser window of the notebooks? If not, the kernels may still be running. If you use Jupyter notebooks, try jupyter notebook list to see the running kernels.

1 Like

Yes @mkitti is right. I had jupyter notebook servers running. I think Python kernels will be automatically stopped when you “exit” out of the terminal, but Julia kernels will not be.

1 Like

Novice question: How do I “shutdown the kernels” from the webpages for the notebooks? I’m running this from the REPL with > notebook()

I’ve been noticing this as well. I’ve currently got a julia process running that was created for a notebook, even though the jupyter server is no longer on.

This pattern is working for me with IJulia, Julia 1.6, MAC Big Sur,

use notebook() and then navigate to the place where your notebooks are
or
navigate to the place where your notebooks are, then type notebook(dir=pwd())
and then do whatever you need to do, opening as many notebooks as you like.

When it’s time to shut down. Shut down each notebook with (1) save and (2) cntrl-w. You will be left with the single notebook web page in the directory. Shut that one down by hitting the quit button. Then shutdown the whole works with logout.

Julia will fester for a bit before you see the julia> prompt, but you will see it. If you do exit() and then ps -A | grep Julia you will not see any rogue processes.

This worked for me, but YMMV.