title: Hibernate ScrollableResults OutOfMemory
body: <p>I have 7500 rows in Table User in MySQL db,VM option : -Xmx8m and some code below :</p>
  
  <pre><code>Query query = session.createQuery("select u from User u");
          ScrollableResults resultSet = query.setFetchSize(Integer.MIN_VALUE).setReadOnly(true).scroll(ScrollMode.FORWARD_ONLY);
  
          int i = 0;
          while (resultSet.next()) {
              User o = (User) resultSet.get(0);   
              System.out.println(o.getId());    
              i++;
              if (i % 50 == 0) {
                  session.clear();
              }
          }
          resultSet.close();
  </code></pre>
  
  <p>But unfortunately I have this output in my console :
  ...
  5745
  Exception in thread "main" java.lang.OutOfMemoryError: GC overhead limit exceeded.</p>
  
  <p>But I do not understand why?? Integer.MIN_VALUE - serves as a signal to the driver to stream result sets row-by-row. Maybe I have a problem cause ScrollableResults stored in memory and 8m of heap is not enough ??</p>