# Julia on VSCode Notebook does not clean RAM and hangs if notebook restarted

**URL:** <https://discourse.julialang.org/t/julia-on-vscode-notebook-does-not-clean-ram-and-hangs-if-notebook-restarted/104535>\
**Category:** Performance\
**Tags:** question\
**Created:** [October 3, 2023, 10:13am UTC](https://discourse.julialang.org/t/julia-on-vscode-notebook-does-not-clean-ram-and-hangs-if-notebook-restarted/104535 "2023-10-03T10:13:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Simone\_Gabbriellini](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/simone_gabbriellini/32/202218_2.png) [@Simone\_Gabbriellini](https://discourse.julialang.org/u/Simone_Gabbriellini)\
**Post date:** [October 3, 2023, 10:13am UTC](https://discourse.julialang.org/t/julia-on-vscode-notebook-does-not-clean-ram-and-hangs-if-notebook-restarted/104535/1 "2023-10-03T10:13:30Z")

</div>

I have a notebook I use in VSCode, with a kernel Julia 1.9.3, that uses the package Agents. I launch a distributed simulation on 10 cores on my Ubuntu 18.04. The model loads a CSV file (50MB), then I launch, say, 30 simulations on my 10 workers.  
Every time I launch the simulations, at the end my RAM increases of 6GB and stays that way indefinitely, no matter if I close the notebook: every time I run, I have some more RAM occupied and never cleared.  
Also, I noticed that when I close or stop the notebook, I have a Julia process occupying a core on my machine indefinitely until I manually kill it…  
Do you have any hints on how to spot memory leaks? or is this a known problem using Julia kernels in VSCode?

---

<div class="post-metadata">

**Author:** ![Simone\_Gabbriellini](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/simone_gabbriellini/32/202218_2.png) [@Simone\_Gabbriellini](https://discourse.julialang.org/u/Simone_Gabbriellini)\
**Post date:** [October 4, 2023, 8:37am UTC](https://discourse.julialang.org/t/julia-on-vscode-notebook-does-not-clean-ram-and-hangs-if-notebook-restarted/104535/2 "2023-10-04T08:37:12Z")

</div>

ok I have seen that to free memory you need to explicilty call `rmprocs(workers())`

I guess only point that remains is the problem with the notebook…
