What's the defined_classes in a Java thread dump?

161 views Asked by At

Rinning jstack -e produces a dump like this (at least in Java 19):

"Thread-0" #25 [23276] prio=5 os_prio=0 cpu=0.00ms elapsed=593.30s allocated=6720B defined_classes=1 tid=0x0000023dafe60b20 nid=23276 waiting for monitor entry [0x000000796a4ff000]

What does "defined_classes" mean here?

2

There are 2 answers

0
Progman On BEST ANSWER

This output is coming from the enhancement JDK-8200720. Its implementation defines this values as follow:

  • defined_classes=... : The number of classes defined by this thread

This might hint to a thread that loads too many classes.

It was added in commit d1b24f2ceca5 on 25 Jun 2018.

0
Emmanuel Collin On

This attribute gives the number of classes defined by this thread.