When classes in jars enter PermGen

I understand that PermGen (in a sense) contains class code in memory. Often we have many jar files referenced by our classpath. When the jar file is included in the class path (say, in the tomcat lib directory), are all the classes of all these jars loaded automatically in PermGen?

In a similar question, when a jar file class is used, PermGen loads all the classes in that jar file, or only the class that is used (and then loads the rest of the class files when necessary)

+5
source share
4 answers

To some extent, it depends on the implementation of classloader and the JVM - The Java Virtual Machine Specification says the following:

, (, - , ) , , Java , [...]

, , ( ), , ( ). , , , .

JAR , , , .

+4

PermGen - HotSpot, Oracle , [1]. Java (VM). PermGen. ClassLoader#loadClass, . ( ), - , . . , Spring, .

VisualVM, PermGen.

[1] JRockit PermGen, HotSpot PermGen.

+2

.

0

JLS , , - - . .

0
source

All Articles