Query cache OOM for too large beans #3645
Merged
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.
Hi @rob-bygrave,
we have a problem with the query cache that holds whole beans inside the memory. If these beans are too big, a potential OOM can occur.
I created a test that uses a 'big' bean in an '.eq' expression without the specific id call.
The easy solution would be the usage of '.id'
.eq("child.id", DB.reference(MemleakChild.class, id).id).I added a potential draft to fix this. What default would you expect in this case? Should I always use .id or should this be handled automatically if possible. Let me hear what you think about this.