# How to free space in .julia

**URL:** https://discourse.julialang.org/t/how-to-free-space-in-julia/76621
**Category:** New to Julia
**Created:** [February 17, 2022, 11:18am UTC](https://discourse.julialang.org/t/how-to-free-space-in-julia/76621 "2022-02-17T11:18:57Z")
**Posts on this page:** 15
**Page:** 1

<div class="post-metadata">

### Author: ![sbacelar](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sbacelar/32/4359_2.png) [@sbacelar](https://discourse.julialang.org/u/sbacelar)
#### Post date: [February 17, 2022, 11:18am UTC](https://discourse.julialang.org/t/how-to-free-space-in-julia/76621/1 "2022-02-17T11:18:57Z")

</div>

I have 28.6 Gb in `.julia`. What is the best way to free some space?

---

<div class="post-metadata">

### Author: ![feanor12](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/feanor12/32/8212_2.png) [@feanor12](https://discourse.julialang.org/u/feanor12)
#### Post date: [February 17, 2022, 11:31am UTC](https://discourse.julialang.org/t/how-to-free-space-in-julia/76621/2 "2022-02-17T11:31:08Z")

</div>

Maybe try  
`import Pkg;Pkg.gc()`

---

<div class="post-metadata">

### Author: ![sbacelar](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sbacelar/32/4359_2.png) [@sbacelar](https://discourse.julialang.org/u/sbacelar)
#### Post date: [February 17, 2022, 2:56pm UTC](https://discourse.julialang.org/t/how-to-free-space-in-julia/76621/3 "2022-02-17T14:56:25Z")

</div>

Maybe I am doing something wrong because the result is the same.

```julia
import Pkg;Pkg.gc()
      Active manifest files: 50 found
      Active artifact files: 299 found
      Active scratchspaces: 36 found
     Deleted no artifacts, repos, packages or scratchspaces

```

---

<div class="post-metadata">

### Author: ![jlperla](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jlperla/32/34332_2.png) [@jlperla](https://discourse.julialang.org/u/jlperla)
#### Post date: [February 17, 2022, 3:03pm UTC](https://discourse.julialang.org/t/how-to-free-space-in-julia/76621/4 "2022-02-17T15:03:07Z")

</div>

> [@sbacelar](#):
>
> What is the best way to free some space?

Just delete the entire folder and start fresh! Redoing an `] instantiate` on a project file or two used to take hours but now is extremely fast.

---

<div class="post-metadata">

### Author: ![feanor12](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/feanor12/32/8212_2.png) [@feanor12](https://discourse.julialang.org/u/feanor12)
#### Post date: [February 17, 2022, 3:14pm UTC](https://discourse.julialang.org/t/how-to-free-space-in-julia/76621/5 "2022-02-17T15:14:41Z")

</div>

If it is just packages deleting is fine, I think, but also temporary notebooks are stored in that folder.  
Maybe check what is really using the disk space.

---

<div class="post-metadata">

### Author: ![simeonschaub](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/simeonschaub/32/216566_2.png) [@simeonschaub](https://discourse.julialang.org/u/simeonschaub)
#### Post date: [February 17, 2022, 3:19pm UTC](https://discourse.julialang.org/t/how-to-free-space-in-julia/76621/6 "2022-02-17T15:19:01Z")

</div>

Please don’t recommend that without any preface! You might have a lot of dev’ed packages you modified in `.julia` or Pluto also saves notebooks there, so don’t just delete it unless you are 100% sure there isn’t any data you care about in there!

---

<div class="post-metadata">

### Author: ![t-bltg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/t-bltg/32/25526_2.png) [@t-bltg](https://discourse.julialang.org/u/t-bltg)
#### Post date: [February 17, 2022, 3:29pm UTC](https://discourse.julialang.org/t/how-to-free-space-in-julia/76621/7 "2022-02-17T15:29:12Z")

</div>

Try

```julia
import Pkg, Dates
Pkg.gc(collect_delay=Dates.Day(0))

```

---

<div class="post-metadata">

### Author: ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)
#### Post date: [February 17, 2022, 3:37pm UTC](https://discourse.julialang.org/t/how-to-free-space-in-julia/76621/8 "2022-02-17T15:37:28Z")

</div>

> [@sbacelar](#):
>
> ` Active manifest files: 50 found`

50 active manifests? Maybe you want to clean them up: [GitHub - giordano/PkgCleanup.jl: Cleanup unused Julia environments and artifacts](https://github.com/giordano/PkgCleanup.jl)

---

<div class="post-metadata">

### Author: ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)
#### Post date: [February 17, 2022, 3:51pm UTC](https://discourse.julialang.org/t/how-to-free-space-in-julia/76621/9 "2022-02-17T15:51:09Z")

</div>

Hmm, I have 62… never thought about this. Just to make sure I understand - active manifest just means that the manifest has been activated at some point in the past (my `manifest_usage.toml` file has entries that are as old as my laptop) and any package mentioned in any of these manifests will not get removed by `]gc --all`?

On the other hand, deleting entries manually from `manifest_usage.toml` will allow those packages to be gc’ed, but will not remove the `Manifest.toml` file itself, meaning I can (and have to) to `]instantiate` if I do use one of those old projects again?

---

<div class="post-metadata">

### Author: ![runjaj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/runjaj/32/23628_2.png) [@runjaj](https://discourse.julialang.org/u/runjaj)
#### Post date: [February 17, 2022, 4:04pm UTC](https://discourse.julialang.org/t/how-to-free-space-in-julia/76621/10 "2022-02-17T16:04:00Z")

</div>

My Julia installation has 7 Gb, but almost 4 Gb are conda (required for SymPy.jl). Maybe it’s something to check as well.

---

<div class="post-metadata">

### Author: ![sbacelar](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sbacelar/32/4359_2.png) [@sbacelar](https://discourse.julialang.org/u/sbacelar)
#### Post date: [February 17, 2022, 4:27pm UTC](https://discourse.julialang.org/t/how-to-free-space-in-julia/76621/11 "2022-02-17T16:27:00Z")

</div>

In my case 4.8 Gb for `conda`.

---

<div class="post-metadata">

### Author: ![jlperla](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jlperla/32/34332_2.png) [@jlperla](https://discourse.julialang.org/u/jlperla)
#### Post date: [February 17, 2022, 4:33pm UTC](https://discourse.julialang.org/t/how-to-free-space-in-julia/76621/12 "2022-02-17T16:33:36Z")

</div>

> [@simeonschaub](#):
>
> Please don’t recommend that without any preface! You might have a lot of dev’ed packages you modified in `.julia` or Pluto also saves notebooks there, so don’t just delete it unless you are 100% sure there isn’t any data you care about in there!

Ah sorry, didn’t know about Pluto. Yes, if you dev into that rather than cloning and locally doing it then those are an issue as well.

---

<div class="post-metadata">

### Author: ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)
#### Post date: [February 17, 2022, 5:33pm UTC](https://discourse.julialang.org/t/how-to-free-space-in-julia/76621/13 "2022-02-17T17:33:44Z")

</div>

Correct. You may want to “deactivate” environments you don’t use very often, so as to let `Pkg.gc` clean the packages/artifacts used by them. If you do so, the next time you activate them you’ll have make sure to run `]instantiate`, yes. But if you don’t use those environment very often, the next occasion may be in a long time.

---

<div class="post-metadata">

### Author: ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)
#### Post date: [February 17, 2022, 5:35pm UTC](https://discourse.julialang.org/t/how-to-free-space-in-julia/76621/14 "2022-02-17T17:35:30Z")

</div>

I had no idea that’s how it worked - just removed about 4GB of package installations and artefacts related to those 62 active manifests, thank you!

A related question while we’re at it: what’s a scratchspace?

---

<div class="post-metadata">

### Author: ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)
#### Post date: [February 17, 2022, 5:36pm UTC](https://discourse.julialang.org/t/how-to-free-space-in-julia/76621/15 "2022-02-17T17:36:58Z")

</div>

[https://github.com/JuliaPackaging/Scratch.jl](https://github.com/JuliaPackaging/Scratch.jl)
