title: Memory leak in org.hibernate.engine.internal.EntityEntryContext$ManagedEntityImpl
body: <p>Getting memory leak in org.hibernate.engine.internal.EntityEntryContext$ManagedEntityImpl</p>
  
  <pre><code>At the time the leak was detected, 19323 objects existed of class
  </code></pre>
  
  <p>org.hibernate.engine.internal.EntityEntryContext$ManagedEntityImpl</p>
  
  <p>These objects had been created at</p>
  
  <p>org.hibernate.engine.internal.EntityEntryContext.addEntityEntry(java.lang.Object, org.hibernate.engine.spi.EntityEntry):96</p>
  
  <p>and were being held
  in table of java.util.IdentityHashMap</p>
  
  <pre><code>in nonEnhancedEntityXref of org.hibernate.engine.internal.EntityEntryContext
      in entityEntryContext of org.hibernate.engine.internal.StatefulPersistenceContext
        in persistenceContext of org.hibernate.internal.SessionImpl
          in session of org.springframework.orm.hibernate4.SessionHolder
            in value of java.util.HashMap$Entry
              in table of java.util.HashMap
                in value of java.lang.ThreadLocal$ThreadLocalMap$Entry
                  in table of java.lang.ThreadLocal$ThreadLocalMap
                    in threadLocals of org.apache.tomcat.util.threads.TaskThread
  </code></pre>
  
  <p>Please suggest if this can be resolved if we migrate to hibernate-core-4.3.7.Final.jar .
  Currently we are using hibernate-core-4.2.0.Final.jar.?
  Based on <a href="https://github.com/hibernate/hibernate-orm/pull/767" rel="nofollow">https://github.com/hibernate/hibernate-orm/pull/767</a></p>