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

Reuse the BufferedImage in SwingOffscreenRenderer #996

Merged
merged 2 commits into from
Oct 22, 2024

Conversation

samofcorinth
Copy link
Contributor

Fix for https://youtrack.jetbrains.com/issue/CMP-6722/Excessive-garbage-generation-from-redrawing

Previously, the draw method would allocate a BufferedImage on every redraw, which is wasteful. This fix changed SwingOffscreenRenderer to reuse the same instance of BufferedImage and only clear it on redraws. Only changing the draw size would allocate a new BufferedImage.

@samofcorinth
Copy link
Contributor Author

Thanks for the review!

@m-sasha m-sasha self-requested a review October 19, 2024 09:12
@mazunin-v-jb mazunin-v-jb merged commit bbfaf62 into JetBrains:master Oct 22, 2024
6 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.

5 participants