-->

加快Tomcat的在调试模式下使用Eclipse IDE(Speeding up Tomcat in

2019-07-04 11:35发布

Running Tomcat through eclipse works fine in non-debug mode, but not in debug mode. When I try to start the Tomcat server in debug mode, the console output looks fine for a while, but then starts slowing down and eventually just stops, pegging the cpu at 100%. I don't think it's relevant, but just in case - here's the console output right about when it starts slowing down and eventually stopping (by stopping I mean no more console output, but still 100% cpu).

2009-09-02 14:35:30,859 INFO   NONE org.springframework.context.weaving.DefaultContextLoadTimeWeaver:72 - Found Spring's JVM agent for instrumentation
2009-09-02 14:35:49,562 INFO   NONE org.springframework.beans.factory.support.DefaultListableBeanFactory:414 - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@ed889d: defining beans [...
2009-09-02 14:37:31,031 INFO   NONE org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean:221 - Building JPA container EntityManagerFactory for persistence unit ...

I tried everything I could think of to fix it:

  • cleanesd tomcat working directory
  • restarted eclipse
  • restarted Windows
  • refreshed/cleaned all projects

I first had this problem last week using eclipse ganymede. I had been running fine in debug-mode for several months prior to this issue. I didn't make any significant changes to our project that would cause this. Eventually, I upgraded to eclipse galileo which solved my problem. Now 2 days later, I'm having the same problem in galileo. Like I said it works fine in non-debug mode. Any help is much appreciated.

I should add that other things work in debug mode - for instance junit tests, so it is something specific to tomcat.

Answer 1:

我已经通过这个问题得到了! 一旦我想通了,我记得以前有此情况。 我清了所有的断点,它工作正常。 我不知道为什么这样做会导致不就是结局,但它的作品。



Answer 2:

我只是碰到了这个问题我自己,而这个解决方案在帮助我。 然而 - 我只用了1个断点,而不是其他的海报20+。 我的一个断点,然而,是一个方法断点,而不是一个行断点 - 不知法的众多来电Tomcat启动与方法断点合并可能会造成这个问题......我只是想一个小实验:

  1. 设置行断点和启动调试模式 - 第5次启动(正常)
  2. 设置的方法断点和启动调试模式 - 不.....愿意等待(> 90秒)。

我猜这就是问题所在。



Answer 3:

我在伽利略有同样的问题。 跑得快,但爬行调试。 由于该帖子上面,我清除所有的断点并重新启动Tomcat的。 奇迹般地解决了这一问题。 仅供参考 - 我有2个方法断点和其他早一行断点。 我做了测试,以确认上述理论方法有关断点放缓。 这里是我的发现。 看起来这不是方法断点这是问题,问题是它仍然显示在调试视图中的断点列表中向上的方法断点,但代码是不存在的。 我的意思是我改变了方法的参数,但是旧的断点与旧参数在断点名单仍然存在。 这是罪魁祸首,当我删除了,其他的方法断点没有减缓服务器。 所以看起来像日食试图寻找的东西不存在的,这似乎已经放慢下来。 希望这可以帮助。



Answer 4:

在这个问题上我也迷迷糊糊。

我关闭了所有无关的项目。 清空了我的断点。 增加STS VM的内存。 按照此博客: http://searchforsolutions.wordpress.com/2011/12/01/eclipse-jvm-settings-for-optimized-performance/禁用JBoss的工具,验证和所有其他验证。

现在STS就像一个魅力的作品!



Answer 5:

从更改默认的日志记录级别:

<root>
  <level value="DEBUG" />
  <appender-ref ref="ConsoleAppender" />
</root>

至 :

<root>
  <level value="OFF" />
  <appender-ref ref="ConsoleAppender" />
</root>


文章来源: Speeding up Tomcat in debug mode with Eclipse IDE