JDK-6469656 : JConsole keeps creating new threads
  • Type: Bug
  • Component: tools
  • Sub-Component: jconsole
  • Affected Version: 6
  • Priority: P5
  • Status: Closed
  • Resolution: Not an Issue
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2006-09-12
  • Updated: 2011-02-16
  • Resolved: 2007-05-17
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7
7Resolved
Related Reports
Relates :  
Description
FULL PRODUCT VERSION :
java version "1.6.0-rc"
Java(TM) SE Runtime Environment (build 1.6.0-rc-b98)
Java HotSpot(TM) Client VM (build 1.6.0-rc-b98, mixed mode, sharing)

ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [Version 5.1.2600]

A DESCRIPTION OF THE PROBLEM :
It seems as the SwingWorker thread pool used in JConsole keeps creating new threads and discarding old ones.

Having let JConsole run for approximately 2�� hour. I see threads having names like
   SwingWorker-pool-1-thread-23615

That means JConsole is creating around 10000 threads/hour. Now even if the creation of threads does not have a great overhead. It kind of defies the purpose of having a thread pool.



STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Start JConsole

Connect to jconsole process from within jconsole.

Select Threads-tab


REPRODUCIBILITY :
This bug can be reproduced always.

Comments
EVALUATION The SwingWorker class is designed to let pool threads exit if idle for one second. Most JConsole work will finish within the given time interval (four seconds by default), so threads are not often reused. When monitoring many connections with a short interval, then the workers tend to not finish as quickly, and threads do get reused from the pool. This is not a JConsole bug.
17-05-2007