Skip to content

Azure backed registry heavily leaks memory #620

Closed

Description

@jesper

Using registry 2.0.1.

I discovered this memory leak after a registry crash that occurred while pushing several images to my private registry: https://gist.github.com/jesper/25231332f99c92393023

After re-starting the registry, I ran "docker stats registry" and observed the memory usage. Each push to the registry slowly increases the memory usage until it finally falls over. Even if the images have not changed, the memory usage still grows on each push attempt.

Activity

  1. dmp42 commented on Jun 11, 2015

    @dmp42
    Contributor
  2. ahmetb commented on Jun 11, 2015

    @ahmetb
    Contributor

    ack I can reproduce the behavior, I'll be back with a fix.

  3. ahmetb commented on Jun 11, 2015

    @ahmetb
    Contributor

    I think I found out the root cause. In the Azure SDK, we didn't defer resp.Body.Close() in some hot code paths (i.e. upload blob) by mistake and apparently the connection just stays there dangling, gets a hold to the 4 MB chunks it uploads.

    I'm going to add all the missing defer statements to the Azure Go SDK today and will work on updating the vendored package today.

  4. added this to the Registry/2.1 milestone on Jun 11, 2015
  5. dmp42 commented on Jun 11, 2015

    @dmp42
    Contributor

    @ahmetalpbalkan thanks a lot for the super fast reaction here and for taking care of this.
    You rock! :)

  6. ahmetb commented on Jun 12, 2015

    @ahmetb
    Contributor

    Fix at #623.

  7. ahmetb commented on Jun 12, 2015

    @ahmetb
    Contributor

    @dmp42 you guys are the ones really rock everyday!

  8. jesper commented on Jun 12, 2015

    @jesper
    Author

    Thanks so much - you folks are amazing! <3

  9. added a commit that references this issue on Apr 22, 2021
    1bec1ae
  10. added a commit that references this issue on Jan 19, 2022
    5c372de
  11. added a commit that references this issue on Jan 5, 2023
    7956215
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions