Hibernate+Ehcache update breaks test suite
We are moving from hibernate 3.2.1 to 3.5.6 and bringing along Ehcache 2.3. It seems like the updates break our full test suite (around 10k tests), in that at some point we run into
Caused by: java.lang.OutOfMemoryError: unable to create new native thread
at java.lang.Thread.start0(Native Method)
at java.lang.Thread.start(Thread.java:597)
at java.util.Timer.<init>(Timer.java:154)
at net.sf.ehcache.util.FailSafeTimer.<init>(FailSafeTimer.java:52)
at net.sf.ehcache.CacheManager.init(CacheManager.java:334)
at net.sf.ehcache.CacheManager.<init>(CacheManager.java:281)
at org.hibernate.cache.EhCacheProvider.start(EhCacheProvider.java:131)
at org.hibernate.cache.impl.bridge.RegionFactoryCacheProviderBridge.start(RegionFactoryCacheProviderBridge.java:72)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:250)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1385)
at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:954)
at org.springframework.orm.hibernate3.LocalS开发者_JS百科essionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:814)
Is there anything obvious I am missing here? I thought hiberante would handle any required ehcache shutdowns to get rid of old threads?
This error indicates that the JVM took too long to free up memory during its GC process. This error can be thrown from the Serial, Parallel or Concurrent collectors. It often means that the Xmx value is too high - you might consider lowering it.
For more severe and persistent performance issues relating to GC, it is recommended to change to a parallel collector, and to ensure that Confluence has access to the memory demanded by its users.
The parallel collector will throw an OutOfMemoryError if too much time is being spent in garbage collection: if more than 98% of the total time is spent in garbage collection and less than 2% of the heap is recovered, an OutOfMemoryError will be thrown. This feature is designed to prevent applications from running for an extended period of time while making little or no progress because the heap is too small. If necessary, this feature can be disabled by adding the option -XX:-UseGCOverheadLimit to the command line.
Check : http://confluence.atlassian.com/display/DOC/Garbage+Collector+Performance+Issues
精彩评论