The compressibility heuristic compressed a 1 MiB sample of each upload into a bytes.Buffer only to read its length, growing up to ~1 MiB of garbage per file. Write the sample through a counting io.Discard-style writer instead so no output buffer is allocated at all.