title: java.lang.OutOfMemoryError: GC overhead limit exceeded Spring Hibernate Tomcat 6
body: <p>I am facing issue in my web application which uses Spring + Hibernate .</p>
  
  <p>I am randomly getting error </p>
  
  <p>java.lang.OutOfMemoryError: GC overhead limit exceeded </p>
  
  <p>when web application is running in tomcat </p>
  
  <p>I tried to get Heap dump and did analysis of heap dump using Eclipse MAT </p>
  
  <p>Here are my findings </p>
  
  <p>Object org.hibernate.impl.SessionFactoryObjectFactory holds 86% of the memory , this object’s Fashhashmap instance holds more than 100000 Hashmaps.
  Inside the every Hashmap there is an instance of org.hibernate.impl.SessionFactoryImpl , 
  It seems org.hibernate.impl.SessionFactoryImpl is loaded several times and stored inside org.hibernate.impl.SessionFactoryObjectFactory ‘s Fashhashmap</p>
  
  <p>Can somebody help me in finding root cause for this issue and suggest some solution to fix this.</p>