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

[DWARFLinker] Release input DWARF after object has been linked #68376

Merged

Conversation

JDevlieghere
Copy link
Member

dsymutil is using an excessive amount of memory because it's holding on to the DWARF Context, even after it's done processing the corresponding object file. This patch releases the input DWARF after cloning, at which point it is no longer needed. This has always been the intended behavior, though I didn't bisect to figure out when this regressed.

When linking swift, this reduces peak (dirty) memory usage from 25 to 15 gigabytes.

rdar://111525100

dsymutil is using an excessive amount of memory because it's holding on
to the DWARF Context, even after it's done processing the corresponding
object file. This patch releases the input DWARF after cloning, at which
point it is no longer needed. This has always been the intended
behavior, though I didn't bisect to figure out when this regressed.

When linking swift, this reduces peak (dirty) memory usage from 25 to 15
gigabytes.

rdar://111525100
Copy link
Collaborator

@avl-llvm avl-llvm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@JDevlieghere JDevlieghere merged commit 29a1567 into llvm:main Oct 6, 2023
3 checks passed
@JDevlieghere JDevlieghere deleted the jdevlieghere/dsymutil-dirty-memory branch October 6, 2023 15:00
JDevlieghere added a commit to apple/llvm-project that referenced this pull request Oct 6, 2023
…68376)

dsymutil is using an excessive amount of memory because it's holding on
to the DWARF Context, even after it's done processing the corresponding
object file. This patch releases the input DWARF after cloning, at which
point it is no longer needed. This has always been the intended
behavior, though I didn't bisect to figure out when this regressed.

When linking swift, this reduces peak (dirty) memory usage from 25 to 15
gigabytes.

rdar://111525100
(cherry picked from commit 29a1567)
JDevlieghere added a commit to apple/llvm-project that referenced this pull request Oct 6, 2023
[DWARFLinker] Release input DWARF after object has been linked (llvm#68376)
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.

None yet

2 participants