Thank you for your detailed response. Your clarification about Hibernate Search “smart” indexing was particularly useful in my case.
I’ve analyzed the includePaths, of one of my problematic root entities, and discovered places, in some child entities, where those depth can be reduced without compromising our users’ abilities to run their queries.
That did the trick. No more OOM errors.
One final clarification: your example about “smart” indexing was for when a root entity had depth 4, but the child had depth 2 (resulting in a “smart” indexing, of depth 3 from root).
Does that apply in reverse? E.g. if root entity had depth 2, and the immediate child entity had depth 2, would that result be an absolute depth of 3?
D