Skip to content

Do not dup nonfrozen string on download (Fix memory leak) #754

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

Merged
merged 1 commit into from
Jul 5, 2022

Conversation

TheSmartnik
Copy link
Collaborator

@TheSmartnik TheSmartnik commented Jul 5, 2022

dup was introduced here to avoid problems where response body was frozen. Unfortunately, it came with a huge memory penalty and caused a memory leak

Following https://gitlab.com/gitlab-org/gitlab/-/issues/29196 and using provided benchmark here are the results (GC was disabled)

Before

rake download

HTTParty: 221.54 MB

After

rake download

HTTParty: 15.67 MB

Memory leak during upload was fixed with #711

@TheSmartnik TheSmartnik merged commit 66f0ecc into master Jul 5, 2022
@TheSmartnik TheSmartnik deleted the fix_download_memory_leak branch July 5, 2022 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant