The following complain is a bit speculative because of unsufficient information. I am happy to be corrected.
I have several Julia versions installed (Windows 10) and started some cleanup, which turned out problematic or impossible.
The current layout of the
.julia folder contains all packages and artefacts of all installed Julia versions, which can’t be destinguished from just the filesystem as they aren’t separated by e.g. folders named as the version of Julia it belongs to. The different package versions are separated in folders named “o35i5”, “zCmTA”,… the artefacts with folders like “01724eb9b7b9ddb287f7edd01bfeb1c8d64ed849”.
So, a quick view into the excellent Pkg documentation and cleaning up is provided, e.g. for v1.4 as:
using Pkg using Dates Pkg.gc(;collect_delay=Dates.Day(0))
(side note: despite excellent, I tried with
Pkg.gc(;collect_delay=0) which doesn’t work, documentation should be a bit more specific)
The garbage collection made some GB free.
After cleaning up my old versions (1.0,1.4,1.5.0) and uninstalling them I made a total free space of 8GB from 24GB in
.julia, so still 16GB with 1.5.3 and 1.6 installed, where 1.6 is nearly unused.
My speculations now are:
- there is still some GB left from old versions
- just uninstalling the old versions would have left all the data in
Pkg.gc()run from a specific Julia version would never touch data from other versions
- If users uninstall an old Julia version they will typically not running
It seems that using Julia over time will inevitable fill space with never be used again data because of Pkg.
Just removing the complete
.julia is not a viable option, because I would also remove folders
environments and risk loss of some work, which is not synced with master repos (if not just local). There are other folders like
prefs which may also mean data loss if removed. I could just remove folders
artifacts and reinstall, but this would still leave data corpses like e.g.
I would prefer a clear visible separation according to the Julia version inside
.julia. So, when I uninstall Julia version 1.0 I can just remove e.g.
.julia/v1.0 without having to care about what is inside. Of course e.g.
dev needs to be somewhere else. A clear separation between user generated and managed data like in
dev, which can not be restored if removed, from installed data from external sources, which can easily be reinstalled, should be the first layer of separation. The second layer of separation would be inside the installed data: the Julia versions should also be visible to be able to remove unused packages of uninstalled Julia versions without the need to reinstall everything for the remaining Julia versions used.