Skip to content

Shrink what an owned AVD costs on disk (partition size, no snapshot on exit), and report device footprint in gc #83

Description

@janicduplessis

Field-measured: two booted rn-iso AVDs cost ~6.4 GB (5011 MB + 1373 MB) and took the internal volume from 15 GB to 117 MB free, which then failed a build with ENOSPC (#81). rn-iso creates these AVDs, so their footprint is rn-iso's to control.

Three concrete levers, all on devices rn-iso owns and destroys with the workspace:

  1. Size the data partition deliberately. avdmanager create avd leaves disk.dataPartition.size at the system image's default, which is generous (multiple GB) for an image that will host one debug app and die with the worktree. rn-iso writes the AVD's config.ini already, so it can set a smaller partition (with a settings key to override for projects that genuinely need more). Measure first: create one AVD each at the default and at a candidate size, install a real debug APK, and record both footprints -- do not guess a number.

  2. Do not write a snapshot on exit (-no-snapshot-save, alongside the headless args in headlessEmulatorArgs). A quick-boot snapshot is GBs, and its whole value is a faster next boot -- which an owned AVD that gets deleted with its worktree never has. Check whether the boot path should also pass -no-snapshot-load for determinism, and whether this changes the cold-boot budget (240s today).

  3. Report the footprint. gc already reports every shared cache with its size and calls out orphans; owned devices are the one large thing it lists without a size. Add the on-disk size of each owned/orphaned device to the report, so "what is this costing me" is answerable without knowing where AVDs live. Also document the footprint in guide cleanup next to the cache sizes.

Out of scope here but adjacent: ~/.gradle/caches reached 24 GB on this machine, and rn-iso now writes into build-cache-1 there via --build-cache. gc does not know about the Gradle caches at all -- worth a separate issue about reporting (never auto-deleting) them.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions