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

Fix ForegroundTextTransformation objects mem leak #373

Merged
merged 2 commits into from
Dec 1, 2023
Merged

Conversation

danipen
Copy link
Collaborator

@danipen danipen commented Sep 26, 2023

To avoid heap mem pressure, we're using an ArrayPool to avoid too many ForegroundTextTransformation allocations.

The issue is that if this class holds a reference to this (TextMateColoringTransformer) via ForegroundTextTransformation.IColorMap interface implementation. This causes all ForegroundTextTransformations that live in memory (in the shared array pool) will be referencing the TextMateColoringTransformer instance, driving a mem leak.

The issue can be avoided by passing the dictionary with the color map to the ForegroundTextTransformation instead of passing an interface.

@danipen danipen changed the title Fix ForegroundTextTransformation objects leak Fix ForegroundTextTransformation objects mem leak Sep 26, 2023
@danipen
Copy link
Collaborator Author

danipen commented Nov 23, 2023

@Gillibald please could you review these changes?

@danipen danipen merged commit 4ea78c7 into master Dec 1, 2023
3 checks passed
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