The selection produced by a query does not use the assigned view

Hi, I’m launching a query from a service that constantly returns “java. lang. OutOfMemoryError: Java heap space”. The returned lines are about 600 although each object has related fields. I have created a view for me to return only the necessary fields but if I look in the log the select of the query is returning me all the fields of the related entities and is not listening to the view. I enclose three images, one with the definition of the view, another with the consultation generated and another with the code of the service.
Thank you and greetings.




First of all, when you use views with EntityManager, the view affects only references and all local attributes are loaded anyway. See details here.
But I doubt that just 600 whatever complex entities can cause OOM exception. I would suggest adding the -XX:+HeapDumpOnOutOfMemoryError option to the java command line and analyzing the heap dump to find the real cause.