Skip to content

Conversation

@Wosch96
Copy link

@Wosch96 Wosch96 commented Jun 27, 2025

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.

@Wosch96 Wosch96 changed the title Query cache oom for too large beans Query cache OOM for too large beans Jun 27, 2025
@rbygrave
Copy link
Member

rbygrave commented Jul 1, 2025

or should this be handled automatically if possible

Well if it's easy enough for people to "get the wrong result" ... then we should address it if we can. So yes this looks like the good and right thing to do.

I'll have another look to see if there are any side effects or if the PR is good to go.

rPraml pushed a commit to FOCONIS/ebean that referenced this pull request Jul 2, 2025
Clean up

Fix imports

no import changes
@rbygrave rbygrave merged commit d918c51 into ebean-orm:master Jul 11, 2025
1 check passed
@rbygrave rbygrave self-requested a review July 11, 2025 09:20
@rbygrave rbygrave added this to the 16.0.0 milestone Jul 11, 2025
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.

2 participants