JDK-8146986 : JDI: Signature lookups for unprepared classes can take a long time
  • Type: Enhancement
  • Component: core-svc
  • Sub-Component: debugger
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2016-01-13
  • Updated: 2020-03-31
  • Resolved: 2019-03-26
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 13
13 b14Fixed
Related Reports
Duplicate :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
VisibleClasses can take very long on high delay networks. The issue is that visibleClasses does not include signatures in its response, and when we on the client side cache the result we need the signature. So for classes that are not previously cached we will do sequential remote calls to load their signature. Those remote calls are what causes the client to "hang" for several minutes.

Worth noting is that most classes will already be cached, with signatures, by either an initial allClasses call, or by the internal event handler. But those only cache classes that are prepared, so this is a problem for unprepared classes.

The ideal solution to this would be to add a new visibleClassesWithSignatures the JDWP spec, which includes signatures.

Another way to fix this (in a hackish way) would be to stop caching some classes. Either caching could be skipped entirely for visibleClasses, or only classes that do not have a signature provided could be skipped. Or, as Martin Entlicher has suggested in JDK-6457137, caching can be removed entirely from JDI. 
Comments
bugdb: https://bug.oraclecorp.com/pls/bug/webbug_edit.edit_info_top?rptno=22097692
11-07-2018

This is not for 10, moving to 11.
14-04-2017

A manual reproducer might be based on jdk/test/com/sun/jdi/ClassLoaderClassesTest.java, if one had some way of ensuring there were lots of unprepared classes (not sure how to do this). Then linux netem (network emulator) could be used to simulate high delays, to provoke the hang.
14-01-2016

Attached patch that skips caching for classes that do not have a signature. It removes the immediate problem, but I'm unsure if it introduces other problems.
13-01-2016