-
Bug
-
Resolution: Fixed
-
P4
-
5.0u4, 6, 8
-
b04
-
generic
-
generic
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8188614 | 8u172 | David Buck | P4 | Resolved | Fixed | b01 |
JDK-8190601 | 8u171 | David Buck | P4 | Resolved | Fixed | b01 |
JDK-8186653 | 8u162 | David Buck | P4 | Resolved | Fixed | b01 |
JDK-8198054 | emb-8u171 | David Buck | P4 | Resolved | Fixed | b01 |
If you load 2 classes with custom classloader, the output of jmap -permstat shows 3 classes for this class loader:
Attaching to process ID 25522, please wait...
Debugger attached successfully.
Client compiler detected.
JVM version is 12.0-b01-fastdebug
586 intern Strings occupying 34032 bytes.
finding class loader instances ..done.
computing per loader stat ..done.
please wait.. computing liveness.................................................done.
class_loader classes bytes parent_loader alive? type
<bootstrap> 317 891720 null live <internal>
0xadb72d18 0 0 null live sun/misc/Launcher$ExtClassLoader@0xb1c97550
0xadb82248 3 3208 0xadb7b320 live java/net/URLClassLoader@0xb1c972a8
0xadb7b320 11 74328 0xadb72d18 live sun/misc/Launcher$AppClassLoader@0xb1ce0610
total = 4 331 969256 N/A alive=4, dead=0 N/A
===
import java.net.*;
import java.io.*;
public class ClassLoading {
public static void main(String[] args) throws Exception {
String dir = new File(".").getCanonicalPath();
URLClassLoader loader = new URLClassLoader(new URL[] { new URL("file://" + dir + "/a.jar") });
Class a = loader.loadClass("A");
Class b = loader.loadClass("B");
Thread.sleep(10000000);
}
}
===
Attaching to process ID 25522, please wait...
Debugger attached successfully.
Client compiler detected.
JVM version is 12.0-b01-fastdebug
586 intern Strings occupying 34032 bytes.
finding class loader instances ..done.
computing per loader stat ..done.
please wait.. computing liveness.................................................done.
class_loader classes bytes parent_loader alive? type
<bootstrap> 317 891720 null live <internal>
0xadb72d18 0 0 null live sun/misc/Launcher$ExtClassLoader@0xb1c97550
0xadb82248 3 3208 0xadb7b320 live java/net/URLClassLoader@0xb1c972a8
0xadb7b320 11 74328 0xadb72d18 live sun/misc/Launcher$AppClassLoader@0xb1ce0610
total = 4 331 969256 N/A alive=4, dead=0 N/A
===
import java.net.*;
import java.io.*;
public class ClassLoading {
public static void main(String[] args) throws Exception {
String dir = new File(".").getCanonicalPath();
URLClassLoader loader = new URLClassLoader(new URL[] { new URL("file://" + dir + "/a.jar") });
Class a = loader.loadClass("A");
Class b = loader.loadClass("B");
Thread.sleep(10000000);
}
}
===
- backported by
-
JDK-8186653 SA: jmap -permstat number of classes is off by 1
-
- Resolved
-
-
JDK-8188614 SA: jmap -permstat number of classes is off by 1
-
- Resolved
-
-
JDK-8190601 SA: jmap -permstat number of classes is off by 1
-
- Resolved
-
-
JDK-8198054 SA: jmap -permstat number of classes is off by 1
-
- Resolved
-