# Julia folder size

**URL:** <https://discourse.julialang.org/t/julia-folder-size/68356>\
**Category:** General Usage\
**Tags:** package\
**Created:** [September 17, 2021, 10:43pm UTC](https://discourse.julialang.org/t/julia-folder-size/68356 "2021-09-17T22:43:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![evad](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/evad/32/15756_2.png) [@evad](https://discourse.julialang.org/u/evad)\
**Post date:** [September 17, 2021, 10:43pm UTC](https://discourse.julialang.org/t/julia-folder-size/68356/1 "2021-09-17T22:43:10Z")

</div>

Can I ask why `~/.julia` folder keeps on growing in size? I need to remove the `~/.julia` folder and reinstall everything once in a while, to keep a small footprint… currently the folder is over 2.8G for 57 packages… whereas reinstalling everything fresh takes 1.7G. and what are the possible ways to trim other than reinstall all packages?

---

<div class="post-metadata">

**Author:** ![CameronBieganek](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cameronbieganek/32/6915_2.png) [@CameronBieganek](https://discourse.julialang.org/u/CameronBieganek)\
**Post date:** [September 17, 2021, 11:12pm UTC](https://discourse.julialang.org/t/julia-folder-size/68356/2 "2021-09-17T23:12:05Z")

</div>

When you update a package, Julia keeps around the old version in case that particular version is needed in the future as a dependency to another package.

Additionally, if you use multiple environments for different projects, the different environments may require different versions of a particular package. So in that case, if you delete your `.julia` directory and only reinstall packages for the main environment, you might not have the necessary versions for your other environments.

You can garbage collect all packages that are no longer used by any of your environments by using the [`gc`](https://pkgdocs.julialang.org/v1/repl/#repl-gc) command in the Pkg REPL:

```nohighlight
(@v1.6) pkg> gc --all

```

---

<div class="post-metadata">

**Author:** ![evad](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/evad/32/15756_2.png) [@evad](https://discourse.julialang.org/u/evad)\
**Post date:** [September 17, 2021, 11:18pm UTC](https://discourse.julialang.org/t/julia-folder-size/68356/3 "2021-09-17T23:18:05Z")

</div>

I tried the gc function, but missed the --all flag. Thanks

> if you delete your `.julia` directory and only reinstall packages for the main environment

so the project.toml also resides in the .julia/enviroments rather than the project folder?

---

<div class="post-metadata">

**Author:** ![CameronBieganek](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cameronbieganek/32/6915_2.png) [@CameronBieganek](https://discourse.julialang.org/u/CameronBieganek)\
**Post date:** [September 17, 2021, 11:21pm UTC](https://discourse.julialang.org/t/julia-folder-size/68356/4 "2021-09-17T23:21:39Z")

</div>

There doesn’t seem to be any duplication of project-level `Project.toml` files in the `.julia/environments` folder, so I’m not sure how `gc` figures that out… I don’t see that information elsewhere in the `.julia` directory, but it might be hidden somewhere…

---

<div class="post-metadata">

**Author:** ![ericphanson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ericphanson/32/215186_2.png) [@ericphanson](https://discourse.julialang.org/u/ericphanson)\
**Post date:** [September 17, 2021, 11:32pm UTC](https://discourse.julialang.org/t/julia-folder-size/68356/5 "2021-09-17T23:32:03Z")

</div>

Check out `.julia/logs`:

```julia
❯ ls ~/.julia/logs
artifact_usage.toml	orphaned.toml scratch_usage.toml
manifest_usage.toml	repl_history.jl

```

`manifest_usage.toml` has got a huge list of manifests + timestamps, so that `Pkg.gc` can know which ones are old to possibly clean up.
