Bug 64527 - JarWarResourceSet gc caused class loading slowly
Summary: JarWarResourceSet gc caused class loading slowly
Status: RESOLVED INVALID
Alias: None
Product: Tomcat 8
Classification: Unclassified
Component: Catalina (show other bugs)
Version: 8.5.39
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: ----
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-06-16 13:02 UTC by aix3
Modified: 2020-06-16 15:26 UTC (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description aix3 2020-06-16 13:02:17 UTC
Hi,
I have a spring boot application with embed tomcat, when i deploy my application(a war package with 329 jar and 227Mb size) to servers, when i first loading a class by Class.forName, it take several seconds.

I debug some tomcat source code, finally i noticed that when i load a class not loaded before, it will always run into getArchiveEntries, it will check archiveEntries is null and load from war file. And i also noticed in JarWarResourceSet gc method will periodic execution set archiveEntries=null.Caused class load slowly when archiveEntries=null, because it will scan all of my war package resources to build a cache.

I'm override JarWarResourceSet let gc method do nothing, it fixed my problem.

But I don’t know if I’m right, so I’m asking here.

tomcat version: 8.5.39
spring boot version: 2.0.9.RELEASE
Comment 1 Mark Thomas 2020-06-16 15:26:09 UTC
Bugzilla is not a support forum. Please direct your question to the Apache Tomcat users mailing list.

http://tomcat.apache.org/lists.html