KEMBAR78
Avoid memory explosion when stress testing `bindgen` by kennykerr · Pull Request #3496 · microsoft/windows-rs · GitHub
Skip to content

Conversation

@kennykerr
Copy link
Collaborator

The windows-bindgen crate's bindgen method is meant to be called once per build but during stress testing, it can be called numerous times from the same process leading to an explosion of memory usage. The winmd reader does an awkward dance with the winmd files to avoid a complex lifetime model. I hope to improve this over time but at least with this change the internal lifetime of the reader and files are scoped to the bindgen function call and thus greatly reduces memory usage during build validation.

@kennykerr kennykerr merged commit ce59d85 into master Feb 19, 2025
90 checks passed
@kennykerr kennykerr deleted the box-reader branch February 19, 2025 15:48
@riverar
Copy link
Collaborator

riverar commented Feb 19, 2025

Thanks!

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