Java Spring Web Application starts slowly in debug mode
Asked Answered
T

3

16

i have a java web application, using Spring, Jersey (jax-rs) and Hibernate.

It runs fine and fast, but there are some days it takes a big amount of time to initialize in debug mode only and when it starts is really slow...

I'm using Eclipse 3.6, Apache Tomcat 6 and java 1.6.0_29 for MAC OS X.

Application begin to log slow after writing this log line:

INFO: Initializing Spring root WebApplicationContext

and before this log lines:

30-dic-2011 10.51.25 com.sun.jersey.api.core.PackagesResourceConfig init
INFO: Scanning for root resource and provider classes in the packages:
    com.example.project.web.rest

How can I investigate? Any suggestions?

Unfortunately I really don't know what I did to reduce performance..

Thanks a lot for help! Davide.

Thymus answered 30/12, 2011 at 10:16 Comment(0)
M
74

One thing that's helped me in a similar situation is to delete all breakpoints in Eclipse. It's worth a try.

Mentalist answered 30/12, 2011 at 11:34 Comment(9)
Unbelieveable... but it does work! :) Actually there is no need to delete the breakpoints, using the "skip all breakpoints" option is enoughPanteutonism
Worked for Idea. And now I wonder - why the hell it worked since there was no breaks communicated!Abuzz
Had same issue even not in debug mode in Idea. Removing breakpoints helped.Detached
thanks @Panteutonism good one. I wouldn't want to delete the break points.Orobanchaceous
While the answer provides a relief, I would be interested to see an answer how to keep breakpoints, but have normal performance. After all we don't add breakpoints for the sport.Gabbard
Worked for me, thanks. To view and delete all breakpoints see here: #12837903Selby
Same worked in intelliJ too. Just skipped the endpoints and it worked fine. ThanksDooryard
Thank God I found this thread... I lost a whole day from cleaning my workspace, running a JVM profiler, clearing my .m2 folder, burning sage, throwing salt over my shoulder and screaming bloody Mary in a dark bathroom 13 times.Surrebutter
@ItGrunt next time, try drinking those bloody Maries instead of screaming them :-)Mentalist
F
3

Method entry-exit breakpoints or conditional breakpoints usually cause this issue. Removing those breakpoints would resolve the issue. It worked for me.

Foramen answered 10/4, 2018 at 9:9 Comment(2)
extremely useful mate.Jennajenne
preferably get rid of such breakpoints as soon as you are done with it.Foramen
K
0

following steps can improve performance

  • Clean Tomcat Work Directory
  • Add/remove application from server>tomcat

I did improved a lot, speeds up debugging process.

Kanishakanji answered 26/9, 2023 at 7:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.