On Fri, 22 May 2026 22:49:11 GMT, Chris Plummer <[email protected]> wrote:

> This tests enables jdb method tracing, which relies on JDWP/JDI 
> MethodEnter/Exit events. Over the years the test has made performance 
> improvements by filtering out more and more classes, but this is only 
> filtering out the events at the JDWP level. JVMTI events are still generated 
> for every method call, and the debug agent needs to process and filter them, 
> and this takes a lot of time. The fix is to trigger some early class loading 
> an initialization before tracing is enabled rather than while tracing is 
> enable. In particular, the following line from MyThread.run(), which is 
> execute while tracing is enabled, triggers a lot of class loading and 
> initialization:
> 
>         String caltype = GregorianCalendar.getInstance().getCalendarType();
> 
> Moving this to the main() method of the debuggee gets it out of the way 
> early. I was seeing about 1.1m method calls while tracing was enabled, and 
> this jumped to 2.2m after 
> [JDK-8384569](https://bugs.openjdk.org/browse/JDK-8384569). It's about 500 
> calls after this change.
> 
> Tested by running the test 100's of times on windows-x64 and also running all 
> svc tier1, tier2, and tier5 tests.
> 
> ---------
> - [x] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).

This pull request has now been integrated.

Changeset: d4b6c78f
Author:    Chris Plummer <[email protected]>
URL:       
https://git.openjdk.org/jdk/commit/d4b6c78f3a3ed2e4c4e9c80c81d6e49b10887e08
Stats:     8 lines in 1 file changed: 5 ins; 0 del; 3 mod

8375062: vmTestbase/nsk/jdb/exclude/exclude001/exclude001.java fails to output 
debuggee prompt after cont cmd

Reviewed-by: dholmes, sspitsyn

-------------

PR: https://git.openjdk.org/jdk/pull/31263

Reply via email to