title: How to force hibernate to release memory once the session is closed?
body: <p>We've just recently started using Hibernate and are still getting used to the way it works.</p>
  
  <p>On of the things we've seen is that even after all sessions are closed and references have gone out of scope, hibernate still seems to maintain the previously used database values in it's cache.</p>
  
  <p>We have code that reads from a set of tables in multiple passes. Because all the memory is freed very sparingly, the later passes slow down to a crawl.</p>
  
  <p>Is there any way to force Hibernate to clear its cache ?</p>
  
  <p>An explicit call to System.gc() doesn't help. (Yes, I know it is a suggestion)</p>
  
  <p><em>Additional Info</em>: We've explicitly disabled the second-level cache.</p>