spring项目加载非常慢
博客专区 > Mr_Qi 的博客 > 博客详情
spring项目加载非常慢
Mr_Qi 发表于3年前
spring项目加载非常慢
  • 发表于 3年前
  • 阅读 2605
  • 收藏 13
  • 点赞 0
  • 评论 0

腾讯云 新注册用户 域名抢购1元起>>>   

  1. 请检查spring是否运行在debug模式下,是跳转到2 否则跳转到3

  2. 查看spring在run模式下是否运行依旧缓慢 是跳转到3,否则跳转到4

  3. 请检验是否spring bean加载了多次(quartz加载很有可能导致部分bean被是实例两次) 是跳转到 http://blog.csdn.net/chaijunkun/article/details/6925889 否则跳转到 http://jinnianshilongnian.iteye.com/blog/1883013 按照步骤检验

  4. 请将代码中所有代码断点禁用掉或者全部删除重新进入到debug模式下查看加载速度是否变快 


发现debug模式下可能导致应用启动速度大幅度变慢。将breakpoint删除后我的应用从 171021ms+43824 ms=====》13021ms+2950ms

解决方案:stackoverflow

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.




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

   http://stackoverflow.com/questions/8678409/java-spring-web-application-starts-slowly-in-debug-mode

共有 人打赏支持
粉丝 189
博文 199
码字总数 207127
×
Mr_Qi
如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!
* 金额(元)
¥1 ¥5 ¥10 ¥20 其他金额
打赏人
留言
* 支付类型
微信扫码支付
打赏金额:
已支付成功
打赏金额: