-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 
Author Message
 Post subject: Tomcat slow startup when in debug mode
PostPosted: Fri May 19, 2006 11:36 am 
Newbie

Joined: Wed Feb 01, 2006 12:29 pm
Posts: 1
When I try to start up tomcat in debug mode (via myeclipse tomcat plugin) on a struts/hibernate application, the initialization of Hibernate sessions goes from 4 seconds to 3.5 minutes. We created a struts plug in that initializes the hibernate configuration upon startup. The log file indicates that the longest amount of time occurs when configuring the ehcache. Here are some times from my log file:

With debug:
2006-05-19 10:04:35,577 WARN net.sf.ehcache.config.Configurator: No configuration found. Configuring ehcache from ehcache-failsafe.xml found in the classpath: file:/C:/apache/Tomcat_5_0/webapps/tams/WEB-INF/classes/ehcache-failsafe.xml
2006-05-19 10:04:38,009 INFO org.hibernate.impl.SessionFactoryObjectFactory: Not binding factory to JNDI, no JNDI name configured

Without debug:
2006-05-19 10:53:51,057 WARN net.sf.ehcache.config.Configurator: No configuration found. Configuring ehcache from ehcache-failsafe.xml found in the classpath: file:/C:/apache/Tomcat_5_0/webapps/tams/WEB-INF/classes/ehcache-failsafe.xml
2006-05-19 10:53:54,018 INFO org.apache.struts.tiles.TilesPlugin: Tiles definition factory loaded for module ''.

Hibernate version: 3.1.2

Name and version of the database you are using: Oracle 10g

Is this difference in time between debug and not debug normal? That's a long time to wait so I turned off running in debug mode but at some point, I'll want to turn it back on. At that point, I'll be making lots of changes to code and will have to restart the application multiple times. Is there a way to speed things up in debug mode?

Thanks,
Jennifer


Top
 Profile  
 
 Post subject: Re: Tomcat slow startup when in debug mode
PostPosted: Tue Feb 27, 2007 9:39 pm 
Newbie

Joined: Sun Oct 08, 2006 8:03 am
Posts: 14
A colleague and I are developing with hibernate 3.2 on tomcat 5.5.17, using Eclipse 3.2.1 and MyEclipse 5.0GA and MySQL 5.0.18. We use the same project source in a subversion repository.

My machine starts in 10s in run mode and 16s in debug mode.
His (newer) one takes 5s in run mode and 90s in debug mode.
We can't work out why his is so much slower in debug mode.

We've traced through the tomcat console output on each machine, and they are identical.

His tomcat slows down just after this line:
INFO [org.springframework.beans.factory.support.DefaultListableBeanFactory] - <Pre-instantiating singletons in factory [org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans [xxDao, yyDao, ...]; parent: org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans [dataSource,jmxExporter,statisticsBean,sessionFactory]; root of BeanFactory hierarchy]>

There are delays in initialising the servlet, but there are further delays in getting tomcat started after that:

2007-02-28 10:14:47,269 INFO [org.springframework.web.servlet.DispatcherServlet] - <FrameworkServlet 'action': initialization completed in 34393 ms>
2007-02-28 10:14:47,285 INFO [org.springframework.web.servlet.DispatcherServlet] - <Servlet 'action' configured successfully>
28/02/2007 10:15:03 org.apache.coyote.http11.Http11BaseProtocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
28/02/2007 10:15:24 org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
28/02/2007 10:15:25 org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/3179 config=null
28/02/2007 10:15:29 org.apache.catalina.storeconfig.StoreLoader load
INFO: Find registry server-registry.xml at classpath resource
28/02/2007 10:15:36 org.apache.catalina.startup.Catalina start
INFO: Server startup in 89155 ms

I'd appreciate any tips for how to isolate the differences between the two machines.

John.


Top
 Profile  
 
 Post subject: Re: Tomcat slow startup when in debug mode
PostPosted: Wed Feb 28, 2007 12:07 am 
Newbie

Joined: Sun Jan 22, 2006 11:46 pm
Posts: 8
Review your IDE's debug breakpoints and make sure that you aren't evaluating any breakpoint conditions. Depending on your IDE, this evaluation can slow things down considerably.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 28, 2007 1:23 am 
Newbie

Joined: Sun Oct 08, 2006 8:03 am
Posts: 14
Mubbled - thanks! It made a huge difference. Deleted all 5 breakpoints, and now it starts in 10s.
Interestingly, putting breakpoints back doesn't seem to slow it down so much, but we're much happier now.
Thanks again.

John.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 28, 2007 9:24 pm 
Newbie

Joined: Sun Jan 22, 2006 11:46 pm
Posts: 8
please feel free to recommend the post and drop us a credit :)


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 28, 2007 9:28 pm 
Newbie

Joined: Sun Oct 08, 2006 8:03 am
Posts: 14
Would if I could, but I think I can't do that because I didn't start the thread. I don't see any buttons. If I'm wrong, please tell me how.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.