I'm trying to improve startup performance of a Java web app in development environment. It uses jetty-maven-plugin and mvn jetty:run
is used to start the app.
I followed instructions at http://www.eclipse.org/jetty/documentation/9.3.x/jetty-classloading.html to register this new CachingWebAppClassLoader
.
<Configure id="mywebapp" class="org.eclipse.jetty.webapp.WebAppContext">
...
<Set name="classLoader">
<New class="org.eclipse.jetty.webapp.CachingWebAppClassLoader">
<Arg><Ref refid="mywebapp"/></Arg>
</New>
</Set>
...
</Configure>
However, org.eclipse.jetty.webapp.WebAppClassLoader.*
continued to show up in jvisualvm CPU sampler but not the CachingWebAppClassLoader
I verified that my registration of classloader is at least being discovered by supplying an invalid class name in which case ClassNotFoundException
was thrown. I'm guessing my configuration of classloader is being consumed but not being used or something like that. Any ideas?
In addition, please let me know if you are aware of any other variants of classloaders that could be used to improve performance.