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 #728: Use WeakHashMap to prevent memory leaks #729

Merged
merged 1 commit into from
Apr 6, 2021

Conversation

ybroeker
Copy link
Contributor

@ybroeker ybroeker commented Apr 6, 2021

Fixes the memory leak by using WeakHashMap.

Copy link
Member

@jmartisk jmartisk left a comment

Choose a reason for hiding this comment

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

Changes LGTM. Please rebase

Copy link
Member

@jmartisk jmartisk left a comment

Choose a reason for hiding this comment

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

Maybe we could remove the map entry for the DataLoader ourselves at some point, but I'm not familiar with the lifecycle of DataLoader objects so I'm not sure when exactly we can do this, and I'd rather not assume too much about how graphql-java will behave. The solution with a weak map, while not necessarily the most efficient, looks at least safe enough, so I'm +1 on this

Copy link
Member

@phillip-kruger phillip-kruger left a comment

Choose a reason for hiding this comment

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

Nice ! Thanks @ybroeker !

@phillip-kruger phillip-kruger added this to the 1.1.3 milestone Apr 6, 2021
@phillip-kruger phillip-kruger merged commit 21fbb19 into smallrye:main Apr 6, 2021
@ybroeker ybroeker deleted the fix/memoryLeak branch April 6, 2021 13:24
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.

3 participants