I am using hibernate 4.3.10, java 1.8 and eclipse neon. I have been trying to execute the following statement in my code. But
java.lang.OutOfMemoryError: Java heap space
is thrown at the second line after a few minutes.
Query query = mySqlSession.createSQLQuery("select * from hops where processed is null");
List<Object[]> lis=query.list();
The problem is this query return about 200k results which is causing the problem. I have refered How to deal with "java.lang.OutOfMemoryError: Java heap space" error (64MB heap size)
after reading solutions from the above link, I changed the memory to 2 GB. Still there seems to be a problem. Any suggestions?