XWiki 13.8 and 13.9: memory leaks and forcibly unregistered drivers

Hi! I keep workingto put in place a brand new XWiki instance running in CentOS Linux release 8.4.2105. Some weeks ago I installed XWiki 13.8 and recently updated to 13.9. My current configuration is

XWiki 13.9 Demo Flavor 1.1

apache-tomcat-9.0.54
MySQL Server version: 8.0.26 Source distribution
mysql-connector-java-8.0.27.jar

CentOS Linux release 8.4.2105

[root@e220i059h057w rjr]# java -version
openjdk version “1.8.0_312”
OpenJDK Runtime Environment (build 1.8.0_312-b07)
OpenJDK 64-Bit Server VM (build 25.312-b07, mixed mode)

When I stop Tomcat, I get the following WARNINGS:

[root@e220i059h057w rjr]# sudo cat /opt/apache-tomcat-current/logs/catalina.out|grep WARNING|grep 19:17
02-Nov-2021 19:17:53.263 WARNING [main] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesJdbc The web application [xwiki] registered the JDBC driver [org.apache.calcite.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
02-Nov-2021 19:17:53.263 WARNING [main] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesJdbc The web application [xwiki] registered the JDBC driver [org.apache.solr.handler.sql.CalciteSolrDriver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
02-Nov-2021 19:17:53.264 WARNING [main] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesJdbc The web application [xwiki] registered the JDBC driver [com.mysql.cj.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
02-Nov-2021 19:17:53.265 WARNING [main] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [xwiki] appears to have started a thread named [RxSchedulerPurge-1] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
02-Nov-2021 19:17:53.266 WARNING [main] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [xwiki] appears to have started a thread named [RxCachedWorkerPoolEvictor-1] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
02-Nov-2021 19:17:53.267 WARNING [main] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [xwiki] appears to have started a thread named [searcherExecutor-15-thread-1] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
02-Nov-2021 19:17:53.268 WARNING [main] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [xwiki] appears to have started a thread named [searcherExecutor-21-thread-1] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
02-Nov-2021 19:17:53.269 WARNING [main] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [xwiki] appears to have started a thread named [searcherExecutor-27-thread-1] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
02-Nov-2021 19:17:53.270 WARNING [main] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [xwiki] appears to have started a thread named [mysql-cj-abandoned-connection-cleanup] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
[root@e220i059h057w rjr]#

I’m planning to move to a Data Source to the container level, looking for a better integration between the container, the JDBC driver, MySQL and XWiki.

There are also three threads named searchExectur-nn. that seems related with Solr. I found at least one Jira could be related issue:

https://jira.xwiki.org/browse/XWIKI-18387

And finally two other threads, RxSchedulerPurge-1 and RxCachedWorkerPoolEvictor-1 about which I can not find any information in the forum or Jira.

Please, have you any idea of the source of the warning? Must I be worried about any of them? Until now, I’ve just created a few pages, and nothing weird seems to happen. Still, I would like to explain the WARNINGS and their relevance before going ahead with any further configuration or creating content.

Thanks!

Depends what you mean by “stop” exactly. If you completely stop Tomcat as in the Tomcat JVM does not run anymore in ps aux then it’s not a problem, those warning are just here to indicate that if you restart the application alone without completely stopping Java (which is not recommended) then those unstopped threads might become ghosts.

Thanks. Thus, it won’t be an issue as I’m using a test server, and I can completely stop the container without affecting other applications. But I would need to explain why these WARNINGs happen and how we can solve them to get XWiki working in a production server connected to the Internet.

Most of the WARNINGS seams related to the JDBC driver, MySQL and Solr. Please, does it make sense to you to move to a Data Source at the container level? Could this contribute to stopping all the threads correctly?

There’s absolutely no problem in production if you stop tomcat and start it again when you want to start/stop xwiki. What you should avoid is to undeploy and redeploy the xwiki webapp while leaving tomcat running.

See Loading...

Other related issues:

1 Like