Open cgwalters opened 1 month ago
@giuseppe @mtrmac PTAL
it happens only with a --compression-level >= 10
There is a discussion in https://github.com/klauspost/compress/discussions/655 and indeed zstd.WithEncoderConcurrency(1)
seems to reduce memory requirements but still needs ~2GB to convert quay.io/fedora/fedora-bootc:40
.
Should we lower the default compression level?
This being my first time needing to profile a Go application's memory usage
I have https://github.com/mtrmac/skopeo/tree/profile-options pending (inspired by Podman’s implementation) from earlier, but I never got around to making that production-ready.
I am consistently getting
skopeo
being OOM killed when running this to convert a local overlay image I have to an OCI zstd:chunked format (so I can easily inspect/debug it):skopeo --dest-compress-format zstd:chunked containers-storage:localhost/bootc-bound oci:/var/home/walters/tmp/oci:bootc-zstd-chunked
:arrow_right:[195791.594936] Out of memory: Killed process 8421 (skopeo) total-vm:12788772kB, anon-rss:7695604kB, file-rss:0kB, shmem-rss:0kB, UID:0 pgtables:16388kB oom_score_adj:0
And yeah, I only have 8G allocated to this podman-machine instance right now.
This being my first time needing to profile a Go application's memory usage, some searching on the internet helped me craft this patch to skopeo:
The results look like this:
That's only 2.4G of memory, but presumably I caught it just before some more serious memory usage inflation.
The next thing I tried was doing "pure"
zstd
(notzstd:chunked
), and that seems quite reliable. The profiler seems to report pretty flat usage: