# How does Julia manage its depot \`~/.julia\`?

**URL:** <https://discourse.julialang.org/t/how-does-julia-manage-its-depot-julia/125015>\
**Category:** Internals & Design\
**Tags:** question\
**Created:** [January 21, 2025, 12:45pm UTC](https://discourse.julialang.org/t/how-does-julia-manage-its-depot-julia/125015 "2025-01-21T12:45:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![WuSiren](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/wusiren/32/42529_2.png) [@WuSiren](https://discourse.julialang.org/u/WuSiren)\
**Post date:** [January 21, 2025, 12:45pm UTC](https://discourse.julialang.org/t/how-does-julia-manage-its-depot-julia/125015/1 "2025-01-21T12:45:52Z")

</div>

It seems that Julia will download all the used packages and corresponding dependencies into its default depot `~/.julia` which is usually located in the disk `C:` of a PC. Will this behavior lead to a dramatic expansion of the storage space of disk `C:`? Does it have an upper bound on the space occupancy? How does Julia manage its depot `~/.julia`?

Thank you!

---

<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:** [January 21, 2025, 12:57pm UTC](https://discourse.julialang.org/t/how-does-julia-manage-its-depot-julia/125015/2 "2025-01-21T12:57:53Z")

</div>

On my PC the folder `.julia` has a size of 22 GB, but that of course depends on the number of packages and Julia versions that you install. Unused packages are garbage collected from time to time. In the folder `.julia/compiled` you find a sub-folder of compiled packages per Julia version. If you do not need an older Julia version any longer you can manually delete the related sub-folder.

Does that answer your question?

---

<div class="post-metadata">

**Author:** ![WuSiren](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/wusiren/32/42529_2.png) [@WuSiren](https://discourse.julialang.org/u/WuSiren)\
**Post date:** [January 21, 2025, 1:07pm UTC](https://discourse.julialang.org/t/how-does-julia-manage-its-depot-julia/125015/3 "2025-01-21T13:07:07Z")

</div>

I see. Thank you very much!

I wonder how often Julia will collect the garbage that the user hasn’t used for a long time and whether Julia allows the user to modify the frequency of garbage collection?

---

<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:** [January 21, 2025, 2:04pm UTC](https://discourse.julialang.org/t/how-does-julia-manage-its-depot-julia/125015/4 "2025-01-21T14:04:49Z")

</div>

You can always run it manually if you want:

```julia
(@v1.10) pkg> gc
      Active manifest files: 32 found
      Active artifact files: 313 found
      Active scratchspaces: 14 found
     Deleted 124 package installations (716.391 MiB)
     Deleted 2 repos (171.160 MiB)
     Deleted 2 artifact installations (40.647 MiB)

```

Just type `gc` in package manager mode. More details: [3. Managing Packages · Pkg.jl](https://pkgdocs.julialang.org/v1/managing-packages/#Garbage-collecting-old,-unused-packages)
