I'm working on a Java (Hibernate+Spring+JavaFX) application. To successfully run this application, I have to set VM : "-Xms512m " otherwise it is failing with below mentioned error.
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [*path/*]:
Constructor threw exception; nested exception is java.lang.OutOfMemoryError: Java heap space.
I have observed that the session factory is consuming 250+ MB to initiate. There are some hbm (hbm POJO's) files which are consuming 180 MB
I also tried the Netbeans Profiler session to reduce memory leaks.
Could you please suggest few steps to reduce VM consumption in the start up of application.
What is the best possible approach to be followed to reduce VM consumption?