membersound
membersound

Reputation: 86757

Application startup difference eclipse and tomcat?

When I develop my application I start it on a tomcat from within eclipse. Everyhing runs fine.

But when I deployed the war file to tomcat and use the startup.bat of tomcat, I'm constantly getting java.lang.OutOfMemoryError: Java heap space error. This occurs during creating of Spring @Bean definitions. It also takes very much time to start at all.

Why is there obviously a difference between starting the app from eclipse and manually in tomcat? And how can I solve this?

Upvotes: 0

Views: 134

Answers (3)

sumanr
sumanr

Reputation: 178

Basically eclipse.ini has all the vm memory arguments set - like -Xms40m -Xmx512m etc The -Xms option sets the initial and minimum Java heap size. The Java heap (the “heap”) is the part of the memory where blocks of memory are allocated to objects and freed during garbage collection. - http://docs.oracle.com/cd/E13150_01/jrockit_jvm/jrockit/jrdocs/refman/optionX.html

You might need to tweek the same for your tomcat.

Upvotes: -1

Stunner
Stunner

Reputation: 1131

Take a look at [this] (http://www.jkstack.com/2012/12/how-to-set-tomcat-heap-size-jvm-heap.html)

There is no difference between starting the app from tomcat and eclipse. However it depends on various parameters like how many tomcat instances are running, any background huge memory consuming java apps running etc.

Upvotes: 0

Aditya
Aditya

Reputation: 1344

Set these vm arguments for tomcat,

-XX:PermSize<size> - Set initial PermGen Size.
-XX:MaxPermSize<size> - Set the maximum PermGen Size.

For more info.

Upvotes: 2

Related Questions