简体   繁体   English

如何调试冻结Windows的Java swing应用程序?

[英]How to debug a Java swing application that freezes Windows?

I am in the process of development of a stand-alone (Swing) Java EE client. 我正在开发独立的(Swing)Java EE客户端。 The application server is JBoss 6.1.0. 该应用程序服务器是JBoss 6.1.0。 Some Windows workstations freeze while the client is running, some do not. 某些Windows工作站在客户端运行时冻结,而有些则没有。 Both 32-bit and 64-bit Windows workstations freeze, and again, some 32-bit and 64-bit Windows workstations work perfectly. 32位和64位Windows工作站都冻结,并且再次,某些32位和64位Windows工作站可以完美运行。 The client runs well on Linux without any problems. 客户端在Linux上运行良好,没有任何问题。

I have followed instructions from StackOverflow where people suggested to disable direct draw with -Dsun.java2d.noddraw=true . 我遵循了StackOverflow上的指示,人们建议使用-Dsun.java2d.noddraw=true禁用直接绘制。 It did not help. 它没有帮助。

What puzzles me the most is that some workstations are almost identical - the same Windows version, the same graphics drivers, the same JRE, yet some work well, some do not. 最让我困惑的是,有些工作站几乎是完全相同的-相同的Windows版本,相同的图形驱动程序,相同的JRE,但有些工作得很好,而有些却不能。

The application uses the Preferences API a lot to store various positions of dockables (from the Docking Frames project), it uses JBoss client classes. 该应用程序大量使用Preferences API来存储可停靠对象的各种位置(来自Docking Frames项目),它使用JBoss客户端类。

I am in the process of investigating if perhaps concurrent access to the Windows registry is causing this problem (if you had similar problems please let me know)... 我正在调查是否可能同时访问Windows注册表导致此问题(如果您有类似问题,请告诉我)...

First guess was that a race condition occurs somewhere in the GUI thread, and the GUI freezes. 首先猜测是争用条件发生在GUI线程中的某处,并且GUI冻结了。 But that would freeze only the GUI, it should not freeze the whole Windows. 但这只会冻结GUI,而不会冻结整个Windows。

The machine, once frozen, responds to pings, however no Windows service works. 机器一旦冻结,便会响应ping,但是Windows服务无法正常工作。

I would appreciate any hint that can help me solve the problem. 我将不胜感激任何可以帮助我解决问题的提示。

Edit: 编辑:

  • CPU usage is always around 10%. CPU使用率始终约为10%。
  • Number of threads never goes above 30, however not all threads are daemon threads (this includes AWT threads, RMI threads, etc). 线程数从不超过30,但是并非所有线程都是守护程序线程(包括AWT线程,RMI线程等)。

Try out the EventQueue with Watchdog . 使用Watchdog尝试EventQueue You install an alternative EventQueue in the Application. 您在应用程序中安装备用EventQueue。 The Watchdog tells you which Events are locking up your GUI. 看门狗告诉您哪些事件正在锁定您的GUI。

It turned out to be ESET. 原来是ESET。 On every Windows machine that had ESET installed I had this problem. 在安装了ESET的每台Windows计算机上,我都遇到了这个问题。 Apparently ESET has this "protocol tracking" feature that is ON by default. 显然,ESET具有此“协议跟踪”功能,默认情况下处于启用状态。 Once turned off we never had this problem. 一旦关闭,我们再也不会遇到这个问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM