GoLand Go Module Cache: Does IDE Clean Up Unused Modules After Closure?
0 reputation · 12 Apr 2021, 02:59 UTC
0 reputation · 12 Apr 2021, 02:59 UTC
GoLand keeps downloaded modules in ~/.cache/go-build, which can grow during long sessions.
During indexing and code analysis, the IDE may retain HTTP responses and test results, causing temporary memory spikes.
It is unclear whether the IDE automatically purges unused module files when the application exits, or if manual cleanup via Settings is required.
Unresolved behavior: Does GoLand perform automatic cache cleanup on shutdown, and if not, what triggers a purge?
Questions:
34775 reputation · 12 Apr 2021, 13:24 UTC
Confirmed: GoLand retains the on‑disk Go module cache (located at $GOMODCACHE or $GOPATH/pkg/mod) after the IDE is closed; there is no built‑in shutdown routine that deletes unused modules.
Settings → Go → Go Modules and click Clean up unused modules. This removes modules that are not referenced by any currently open project.go clean -modcache in a terminal to erase the entire module cache (use with caution).To verify that no automatic purge occurs, check the cache directory size before and after closing GoLand; unchanged size indicates the IDE did not clean it.
Missing diagnostic detail: Are you using Go Modules mode or the legacy GOPATH mode, and which GoLand version are you running? This determines whether the cleanup UI is present.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.