# How to manage Julia's disk usage better?

**URL:** <https://discourse.julialang.org/t/how-to-manage-julias-disk-usage-better/143299>\
**Category:** General Usage\
**Created:** [November 29, 2026, 9:06am UTC](https://discourse.julialang.org/t/how-to-manage-julias-disk-usage-better/143299 "2026-11-29T09:06:55Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ohmsweetohm1](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ohmsweetohm1/32/49126_2.png) [@ohmsweetohm1](https://discourse.julialang.org/u/ohmsweetohm1)\
**Post date:** [November 29, 2026, 9:06am UTC](https://discourse.julialang.org/t/how-to-manage-julias-disk-usage-better/143299/1 "2026-11-29T09:06:55Z")

</div>

My current `.julia` is `34 GB` and seems to be growing indefinitely.  
`] gc` removed measly `24 MB`.

From a user perspective, this is pretty unadaptable. It cannot be the solution to run a cron job and nuke the folder every week.

---

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [November 29, 2026, 10:19am UTC](https://discourse.julialang.org/t/how-to-manage-julias-disk-usage-better/143299/2 "2026-11-29T10:19:05Z")

</div>

The first question is, where is the memory usage coming from. On my machine I use the following command:

```bash
cd .julia
du -k --max-depth=2 . |
awk '
  match($2, /v[0-9]+(\.[0-9]+)+/) {
    version = substr($2, RSTART, RLENGTH)
    kib[version] += $1
  }
  END {
    for (version in kib)
      print kib[version] * 1024, version
  }
' |
sort -k2 |
numfmt --field=1 --to=iec --format="%.1f"

```

which has the output:

```julia-auto
7.3G v1.10
25.0G v1.11
24.9G v1.12
22.3G v1.13
4.8G v1.14

```

I could start with deleting the subfolders for the Julia version I don’t use any longer (not doing that because I have enough disk space).

The next step could be to delete the packages that you only tried out, but not longer use. Start to look at the global environment. On my machine:

```julia
julia> using Pkg; Pkg.status()
Status `~/.julia/environments/v1.14/Project.toml`
⌃ [208986ce] DocBrowser v0.1.1
⌃ [5ee84a8c] KaimonGate v1.7.2
  [16fef848] LiveServer v1.6.0
  [89398ba2] LocalRegistry v0.5.7
  [295af30f] Revise v3.18.0
Info Packages marked with ⌃ have new versions available and may be upgradable.

```

This looks pretty clean, not much to delete here.

Then you could look at the environments of the projects you use most.

You can also use the command:

```julia-auto
du -h --max-depth=2 -c .julia

```

to get a better understanding where the space is going.

If you are on Windows, use a git bash terminal to run the commands.

---

<div class="post-metadata">

**Author:** ![ohmsweetohm1](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ohmsweetohm1/32/49126_2.png) [@ohmsweetohm1](https://discourse.julialang.org/u/ohmsweetohm1)\
**Post date:** [November 29, 2026, 11:50am UTC](https://discourse.julialang.org/t/how-to-manage-julias-disk-usage-better/143299/3 "2026-11-29T11:50:39Z")

</div>

It is not about finding things to delete but the user experience of having to do this myself.

---

<div class="post-metadata">

**Author:** ![ohmsweetohm1](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ohmsweetohm1/32/49126_2.png) [@ohmsweetohm1](https://discourse.julialang.org/u/ohmsweetohm1)\
**Post date:** [November 29, 2026, 11:53am UTC](https://discourse.julialang.org/t/how-to-manage-julias-disk-usage-better/143299/4 "2026-11-29T11:53:17Z")

</div>

Python takes the other approach of having everything a project environment needs into the project. If I update it, the old stuff is gone, if I stop working on the project and remove it, all dependencies are gone too. Not so in Julia.

---

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [November 29, 2026, 12:22pm UTC](https://discourse.julialang.org/t/how-to-manage-julias-disk-usage-better/143299/5 "2026-11-29T12:22:06Z")

</div>

Well, the advantage of the Julia approach is that multiple project can use the same packages (src+compiled+artifacts), you avoid duplication.

If you have suggestions how to make the cleanup easier, please share them. We could add commands to the package manager:

- to delete the packages compiled for a specific Julia version
- to delete the packages not in any manifest any longer
- to delete old versions of the packages that are not longer used

Would that help?

---

<div class="post-metadata">

**Author:** ![ohmsweetohm1](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ohmsweetohm1/32/49126_2.png) [@ohmsweetohm1](https://discourse.julialang.org/u/ohmsweetohm1)\
**Post date:** [November 29, 2026, 12:41pm UTC](https://discourse.julialang.org/t/how-to-manage-julias-disk-usage-better/143299/6 "2026-11-29T12:41:36Z")

</div>

Julia needs to track Manifest files. If a package version is in no Manifest anymore it needs to be removed, same for artifacts and compiled code. If a package is updated and the old version is in no other environment it is dead code. Same story if a project is deleted. Not sure who does that but my solution is a monthly cron that nukes compiled, artifacts and packages.

---

<div class="post-metadata">

**Author:** ![danielwe](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/danielwe/32/35657_2.png) [@danielwe](https://discourse.julialang.org/u/danielwe)\
**Post date:** [November 29, 2026, 12:58pm UTC](https://discourse.julialang.org/t/how-to-manage-julias-disk-usage-better/143299/7 "2026-11-29T12:58:13Z")

</div>

There’s [GitHub - giordano/PkgCleanup.jl: Cleanup unused Julia environments and artifacts · GitHub](https://github.com/giordano/PkgCleanup.jl) for a user-friendly solution. Agree that something like this should be built-in to make it more discoverable.
