Java library size

If I give two Java libraries in jar format, one has no fancy things, and the other has a lot, most of them will not be used My question is:

How do large, mostly unused libraries affect application performance? Does the JVM delay loading classes, and does having a larger class library necessarily mean a larger memory footprint?

Solution

The short answer is that classes are loaded whenever they are needed for the first time Note that "needed" also means "referenced by any other class being loaded."

Therefore, if you have a bunch of classes that have never been touched by any active code, it will not be loaded

If you want to see exactly which classes the JVM is loading and when, you can use the - verbose: class option to invoke Java commands / processes

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>