# Clearing variables in Jupyter Lab

**URL:** <https://discourse.julialang.org/t/clearing-variables-in-jupyter-lab/40709>\
**Category:** General Usage\
**Created:** [June 4, 2020, 6:19am UTC](https://discourse.julialang.org/t/clearing-variables-in-jupyter-lab/40709 "2020-06-04T06:19:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![fusion809](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fusion809/32/6080_2.png) [@fusion809](https://discourse.julialang.org/u/fusion809)\
**Post date:** [June 4, 2020, 6:19am UTC](https://discourse.julialang.org/t/clearing-variables-in-jupyter-lab/40709/1 "2020-06-04T06:19:17Z")

</div>

I’m running a computation in Julia (specifically via Jupyter Lab) that uses up over half of my RAM, and I find if I do not clear my workspace before running it again by shutting down and then restarting the kernel my PC runs out of RAM and crashes. Shutting down and restarting the kernel is a little more tedious than running a command, so I’m hoping someone has a command I can run to clear the workspace instead of having to go through this whole rebooting the kernel process.

To clear the workspace I have tried running `workspace()` and that just returned `UndefVarError: workspace not defined`, and I have also tried running `clearconsole()` which likewise returned `UndefVarError: clearconsole not defined`.

---

<div class="post-metadata">

**Author:** ![JackDevine](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jackdevine/32/1048_2.png) [@JackDevine](https://discourse.julialang.org/u/JackDevine)\
**Post date:** [June 4, 2020, 8:08am UTC](https://discourse.julialang.org/t/clearing-variables-in-jupyter-lab/40709/2 "2020-06-04T08:08:42Z")

</div>

You can free the memory that a variable `x` is taking up by running `x = nothing`. You would just have to find which variables are taking up the most memory and set them to `nothing`.
