[release/9.0] [mono] Make the compressed interface bitmap feature usable #120154
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When this option is enabled, the env var
MONO_COMPRESSED_INTERFACE_BITMAP=1
is passed, the bitmap that stores the set of implemented interfaces by a class is saved in a compressed format. This has significant memory improvement on applications using a lot of types.Customer Impact
This issue was discovered on a large customer application. The memory usage of these bitmaps was so big in this scenario that the application got killed by iOS.
Regression
The memory increase above the tipping point was caused by more types used after transitioning from xamarin to maui. However, this is not strictly a regression.
Testing
This was tested on the customer application. It was also tested with our own set of tests, it was enabled for a few weeks on main.
Risk
Low. This feature is disabled by default so there shouldn't be any impact on existing applications. This PR adds the possibility to use this optimization, which was slightly bit-rotten and behind a compile time define before.