Skip to content

[orc] Reduce memory usage from empty materialization info DenseMaps #88167

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
Apr 9, 2024

Conversation

benlangmuir
Copy link
Collaborator

Saves several MB of memory in larger applications after linking finishes by clearing DenseMap storage that is empty. This does not attempt to shrink partially full materialization infos. The assumption is that adding more after linking finishes is rare.

rdar://126145336

Saves several MB of memory in larger applications after linking
finishes by clearing DenseMap storage that is empty. This does not
attempt to shrink partially full materialization infos. The assumption
is that adding more after linking finishes is rare.

rdar://126145336
@benlangmuir benlangmuir requested a review from lhames April 9, 2024 17:44
@benlangmuir
Copy link
Collaborator Author

@lhames I added these calls after every loop that calls erase() on the materialization infos; if there's a more central place I could put this please let me know, but I didn't see an obvious candidate.

Copy link
Contributor

@lhames lhames left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks Ben!

@benlangmuir benlangmuir merged commit aacb898 into llvm:main Apr 9, 2024
@benlangmuir benlangmuir deleted the memory-after-link branch April 9, 2024 20:01
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.

2 participants