QueryImpl consuming more memory

What you see there is probably the objects that haven’t been collected by the JVM GC, but the proble might be that you are fetchcing more data than necessary.

Try using DTO projections because they are more efficient both on the database and on the client side.

More, if you have huge Result Sets but only require 10 entries, better use pagination.