Can you please help me resolving the following issue:
Context:
We are trying to migrate our existing application which is currently running on Java6
It seems to be an issue in Java8/9 that manifests itself in Jetty due to the annotations module that scans the jars and has a memory leak. Ref. https://github.com/eclipse/jetty.project/issues/575. A solution for me (because I do not use Jetty annotations) is to disable the annotations module by commenting out the lines in jetty/modules/annotations.mod. So tie file looks like this:
#
# Jetty Annotation Scanning Module
#
[depend]
# Annotations needs plus, and jndi features
plus
[lib]
# Annotations needs jetty annotation jars
lib/jetty-annotations-${jetty.version}.jar
# Need annotation processing jars too
#lib/annotations/*.jar
[xml]
# Enable annotation scanning webapp configurations
#etc/jetty-annotations.xml
Edit 1 - Alternative solution
Switching off all annotation scanning can be too drastic, it turns of jsp as well because it is dependent. The alternative is to provide a web application context which restricts the scanning using a pattern. Save this in an xml and deploy it in the webapps together with the war or include it in the war.
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
<Set name="contextPath">/[myApp]</Set>
<Set name="war">/[DIRECTORY]/[myApp[.war</Set>
<Call name="setAttribute">
<Arg>org.eclipse.jetty.server.webapp.WebInfIncludeJarPattern</Arg>
<Arg>SCAN-NO-JARS</Arg>
</Call>
</Configure>