Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix excessive memory and disk usage when sharing layers #2636

Merged
merged 1 commit into from
Nov 26, 2024

Commits on Nov 26, 2024

  1. Fix excessive memory and disk usage when sharing layers

    createNewLayer can add new entries to s.filenames for
    uncompressed versions of layers; these entries don't match
    manifest.LayerInfos, causing the existing logic to assume
    they are a config and to store them as ImageBigData.
    
    That's both a potentially unlimited disk space waste (recording
    uncompressed versions of layers unnecessarily), and a memory
    pressure concern (ImageBigData is created by reading the whole
    blob into memory).
    
    Instead, precisely track the digest of the config, and never
    include more than one file in ImageBigData.
    
    Blobs added via PutBlob/TryReusingBlob but not referenced from
    the manifest are now ignored instead of being recorded inside
    the image.
    
    Signed-off-by: Miloslav Trmač <[email protected]>
    mtrmac committed Nov 26, 2024
    Configuration menu
    Copy the full SHA
    6902e2c View commit details
    Browse the repository at this point in the history