0

On a project, we are using Spring + Hibernate + JPA. Updating to the last version of the COTS, having Hibernate 4.3.x :

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.OutOfMemoryError

Back with version 4.2.14, no problem. I didn't find any reference to this error in the release notes or on google. Anyone also had it ?

Rolintocour
  • 2,934
  • 4
  • 32
  • 63

1 Answers1

0

OutofMemoryerror is the error which we get if your application is making more objects than the Heap size allotted to it. You can increase the Heap size assigned to your project by passing appropriate arguments(xms and xmx) to the application. It could also mean that there is a probable memory leak lurking in your project. try setting appropriate heapsize and then if the issue still exist then you need to look at you implementation and find places where there could be memory leaks.

Please have a look at the following post to understand better : JVM params

Community
  • 1
  • 1
Pratik Shelar
  • 3,154
  • 7
  • 31
  • 51
  • Increased XMX from 1024 to Xmx1336m but still the problem. As it appears only with the Hibernate update, might that not be related ? – Rolintocour Jul 30 '14 at 09:20
  • Are you correctly setting the parameter for your project? How are the other parameters defined? Also are you sure the arguments are getting passed to your project correctly? 1024M of Max heap space is more than enough for Hibernate to load. Do check if there is any static large XMl which you are loading in the init method? – Pratik Shelar Jul 31 '14 at 06:58