# Restarting kernel in Jupyterlab does not kill child processes

**URL:** <https://discourse.julialang.org/t/restarting-kernel-in-jupyterlab-does-not-kill-child-processes/127209>\
**Category:** General Usage\
**Created:** [March 21, 2025, 9:37am UTC](https://discourse.julialang.org/t/restarting-kernel-in-jupyterlab-does-not-kill-child-processes/127209 "2025-03-21T09:37:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Miroboru](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/miroboru/32/47659_2.png) [@Miroboru](https://discourse.julialang.org/u/Miroboru)\
**Post date:** [March 21, 2025, 9:37am UTC](https://discourse.julialang.org/t/restarting-kernel-in-jupyterlab-does-not-kill-child-processes/127209/1 "2025-03-21T09:37:50Z")

</div>

I am often using Jupyterlab when I work with Julia, and for computation intensive tasks I often start out with

```julia
using Distributed
addprocs(25-nprocs())
@everywhere import Dagger

```

From time to time the kernel needs to be restarted, but what happens then is that the processes I already started lives on, but are not available to the newly started kernel, so another 24 processes are started every time this happens.

Killing the processes individually is not a very feasible approach, as is doing a `killall julia` since I often have other Julia processes running.

So, is there a way to kill the processes before restarting the kernel, or is this something that should not happen in the first place? (I am not sure, but I think that this did not use to be a problem before, but I am not sure)

I am currently on Julia 1,11.4 and Jupyterlab 4.3.5 running under Arch Linux with kernel 6.13.5
