Dynamic queries in Hibernate keeps in memory
I use Hibernate in my app and I have this question:
Queries are automatically generated by Hibernate, I use this code to retrieve objects from DB:
Object result = session.get(clazz, id);
where id is a Serializable object.
My app runs for a long time in batch execution. I take an .hprof file to study memory and I have th开发者_C百科is situation: lots and lots of String queries generated by Hibernate. With Eclipse Memory Analyzer (MAT), I see this:
So lots of select... like this are retained in memory and I don't know how to free or dispose them. My app runs out of memory after some time.
Any suggestion would be very helpful. Thanks in advance
精彩评论