JDK-6515686 : Some debug actions are sometimes slow for DestroyJavaVM thread.
  • Type: Bug
  • Component: core-svc
  • Sub-Component: debugger
  • Affected Version: 6
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2007-01-22
  • Updated: 2011-02-16
  • Resolved: 2007-01-27
Related Reports
Duplicate :  
Description
FULL PRODUCT VERSION :
java version "1.6.0"
Java(TM) SE Runtime Environment (build 1.6.0-b105)
Java HotSpot(TM) Client VM (build 1.6.0-b105, mixed mode, sharing)

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

A DESCRIPTION OF THE PROBLEM :
ThreadReference.isAtBreakpoint() and ThreadReference.ownedMonitors() are sometimes very slow for the DestroyJavaVM thread. In our debugger, we're seeing delays as long as two seconds on a 2GHz machine. The procedure below probably demonstrates the problem for jdb. This looks somewhat similar to 6311508.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
jdb Test
stop at Test:3
run
resume
suspend
threads


EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Expect thread data to be displayed quickly.
ACTUAL -
Thread data is displayed quickly up until the DestroyJavaVM thread, for which there is a relatively long delay.

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
public class Test {
   public static void main(String[] args) {
      new javax.swing.JFrame().setVisible(true);
   }
}
---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
Avoid calling isAtBreakpoint() or ownedMonitors() on the DestroyJavaVM thread.

Comments
WORK AROUND The fix for 6440070 also added two new product flags: /* 50 retries * (5 * current_retry_count) millis = ~6.375 seconds */ \ /* typically, at most a few retries are needed */ \ product(intx, SuspendRetryCount, 50, \ "Maximum retry count for an external suspend request") \ \ product(intx, SuspendRetryDelay, 5, \ "Milliseconds to delay per retry (* current_retry_count)") \ To work around an instance of this bug, reduce the number of retries. For example, -XX:SuspendRetryCount=25 will reduce the delay to about 1 second.
27-01-2007

EVALUATION This is a duplicate of: 6459874 3/4 Performance regression in ThreadReference.ownedMonitors() which was fixed in Dolphin-B03. See comments for the details.
27-01-2007