The web application [xwiki] appears to have started a thread named [non-blocking-thread--p2-t8] but has failed to stop it. This is very likely to create a memory leak

XWiki 16 + PSQL
Running on Debian
Using Tomcat9
Hello, I’m seeing this on my Tomcat logs, should I worry?

04-Dec-2024 12:15:25.420 WARNING [main] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [xwiki] appears to have started a thread named [non-blocking-thread--p2-t8] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
 java.base@17.0.13/jdk.internal.misc.Unsafe.park(Native Method)
 java.base@17.0.13/java.util.concurrent.locks.LockSupport.park(LockSupport.java:341)
 java.base@17.0.13/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionNode.block(AbstractQueuedSynchronizer.java:506)
 java.base@17.0.13/java.util.concurrent.ForkJoinPool.unmanagedBlock(ForkJoinPool.java:3465)
 java.base@17.0.13/java.util.concurrent.ForkJoinPool.managedBlock(ForkJoinPool.java:3436)
 java.base@17.0.13/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1630)
 java.base@17.0.13/java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:435)
 java.base@17.0.13/java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1062)
 java.base@17.0.13/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1122)
 java.base@17.0.13/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)

If so, how do I fix it or mitigate it?

Attached is my logfile.
catalina.2024-12-04.log (245.5 KB)

Hello. You should stop tomcat when stopping XWiki and restart Tomcat to restart XWiki (instead of stopping/restarting the XWiki webapp through the Tomcat manager).

We have some issues to fix to prevent tomcat from displaying these messages, see Loading...

Hi @vmassol , I am always using systemctl stop tomcat and then I do systemctl start tomcat to start it.

Afterwards I go to the website and load xwiki (XWiki is initializing).

I’ve never used the tomcat manager.

Is that the proper way?

Yes, it’s the proper way (it does not prevent Tomcat from complaining about XWiki not cleaning properly, but it’s irrelevant).

1 Like