Skip to main content
aspect output-bases lists every Bazel output base on the machine: whose it is, when it was last used, how much memory its Bazel server holds, and how much disk it takes. It changes nothing.
It ends with what to run next: aspect gc when anything is removable, --measure-sizes when sizes were not measured.

States

Each base has a lifecycle state, and the listing groups bases by it. aspect gc removes bases by the same states; the periods below are its defaults.

Columns

A column with no value for any base in a group is left out of that group.

Sorting

--sort orders the bases within each state:

Sizes

Sizes are opt-in: --measure-sizes takes a du of every base, which can take a minute on a machine with tens of gigabytes of them. It adds a size to each state’s count and each listed base, and a table of the Bazel caches shared between bases: the download cache, the repository contents cache and install bases.

JSON

--output=json writes one document to stdout. Its top-level keys are schema_version, sort, policy, counts, servers (running and rss_kb), output_bases, and, with sizes measured, kb and caches (download_cache_kb, repo_contents_cache_kb and install_bases_kb). output_bases is ordered by state, and each entry carries its state (the values in the table above), path, workspace, last_used_ms, and, when known, repository, branch, pid, server_rss_kb and kb. counts and kb key the states as live, idle, orphaned, orphaned_within_grace, pooled, undetermined and trash.

Flags