Доброе время суток!
Наверное поспешили закрыть тему с Tomcat и многопоточность aspose imaging
Я написал простенький servlet, который в методе doGet исполняет следующий код и больше ничего:
try (JpegImage image = (JpegImage) Image.load("test_3.jpg"))
{
JpegOptions options = image.getJpegOptions();
options.setCompressionType(JpegCompressionMode.Baseline);
options.setColorType(JpegCompressionColorMode.YCbCr);
options.setQuality(90);
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
image.save(byteArrayOutputStream, options);
LOG.trace("Size: {}", byteArrayOutputStream.toByteArray().length);
}
catch (Exception exception)
{
}
Но при остановке сервера выдается сообщения об не освобожденных ThreadLocal.
31-Oct-2025 22:58:53.967 WARNING [main] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [ROOT] appears to have started a thread named [weak-ref-list-remover] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
java.base/jdk.internal.misc.Unsafe.park(Native Method)
java.base/java.util.concurrent.locks.LockSupport.park(LockSupport.java:371)
java.base/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionNode.block(AbstractQueuedSynchronizer.java:519)
java.base/java.util.concurrent.ForkJoinPool.unmanagedBlock(ForkJoinPool.java:3780)
java.base/java.util.concurrent.ForkJoinPool.managedBlock(ForkJoinPool.java:3725)
java.base/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1707)
java.base/java.lang.ref.ReferenceQueue.await(ReferenceQueue.java:67)
java.base/java.lang.ref.ReferenceQueue.remove0(ReferenceQueue.java:158)
java.base/java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:234)
com.aspose.imaging.internal.na.t$a.run(Unknown Source)
java.base/java.lang.Thread.run(Thread.java:1623)
31-Oct-2025 22:58:53.967 WARNING [main] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [ROOT] appears to have started a thread named [DisposerCleaner] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
java.base/jdk.internal.misc.Unsafe.park(Native Method)
java.base/java.util.concurrent.locks.LockSupport.park(LockSupport.java:371)
java.base/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionNode.block(AbstractQueuedSynchronizer.java:519)
java.base/java.util.concurrent.ForkJoinPool.unmanagedBlock(ForkJoinPool.java:3780)
java.base/java.util.concurrent.ForkJoinPool.managedBlock(ForkJoinPool.java:3725)
java.base/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1707)
java.base/java.lang.ref.ReferenceQueue.await(ReferenceQueue.java:67)
java.base/java.lang.ref.ReferenceQueue.remove0(ReferenceQueue.java:158)
java.base/java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:234)
com.aspose.imaging.internal.st.a.run(Unknown Source)
java.base/java.lang.Thread.run(Thread.java:1623)
31-Oct-2025 22:58:53.969 SEVERE [main] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [ROOT] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@4d742035]) and a value of type [com.aspose.imaging.system.Threading.Thread] (value [com.aspose.imaging.system.Threading.Thread@13d2a198]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
31-Oct-2025 22:58:53.969 SEVERE [main] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [ROOT] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@95e3b93]) and a value of type [com.aspose.imaging.internal.oi.m] (value [com.aspose.imaging.internal.oi.m@65c7d705]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
31-Oct-2025 22:58:53.969 SEVERE [main] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [ROOT] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@49b15bf6]) and a value of type [com.aspose.imaging.internal.nq.g] (value [com.aspose.imaging.internal.nq.g@314b73f0]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
31-Oct-2025 22:58:53.969 SEVERE [main] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [ROOT] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@4d742035]) and a value of type [com.aspose.imaging.system.Threading.Thread] (value [com.aspose.imaging.system.Threading.Thread@72ca016e]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
31-Oct-2025 22:58:53.969 SEVERE [main] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [ROOT] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@95e3b93]) and a value of type [com.aspose.imaging.internal.oi.m] (value [com.aspose.imaging.internal.oi.m@5bd9bb05]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
31-Oct-2025 22:58:53.970 SEVERE [main] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [ROOT] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@49b15bf6]) and a value of type [com.aspose.imaging.internal.nq.g] (value [com.aspose.imaging.internal.nq.g@6ce9226e]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
31-Oct-2025 22:58:53.970 SEVERE [main] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [ROOT] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@4d742035]) and a value of type [com.aspose.imaging.system.Threading.Thread] (value [com.aspose.imaging.system.Threading.Thread@77454dbf]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
31-Oct-2025 22:58:53.970 SEVERE [main] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [ROOT] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@95e3b93]) and a value of type [com.aspose.imaging.internal.oi.m] (value [com.aspose.imaging.internal.oi.m@48d7aa61]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
31-Oct-2025 22:58:53.970 SEVERE [main] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [ROOT] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@49b15bf6]) and a value of type [com.aspose.imaging.internal.nq.g] (value [com.aspose.imaging.internal.nq.g@4f453c84]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
31-Oct-2025 22:58:53.971 SEVERE [main] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [ROOT] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@4d742035]) and a value of type [com.aspose.imaging.system.Threading.Thread] (value [com.aspose.imaging.system.Threading.Thread@5021c160]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
31-Oct-2025 22:58:53.971 SEVERE [main] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [ROOT] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@95e3b93]) and a value of type [com.aspose.imaging.internal.oi.m] (value [com.aspose.imaging.internal.oi.m@2d20aacc]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
31-Oct-2025 22:58:53.971 SEVERE [main] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [ROOT] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@49b15bf6]) and a value of type [com.aspose.imaging.internal.nq.g] (value [com.aspose.imaging.internal.nq.g@69e780ff]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
31-Oct-2025 22:58:53.971 SEVERE [main] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [ROOT] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@4d742035]) and a value of type [com.aspose.imaging.system.Threading.Thread] (value [com.aspose.imaging.system.Threading.Thread@32dc7ae3]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
31-Oct-2025 22:58:53.971 SEVERE [main] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [ROOT] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@95e3b93]) and a value of type [com.aspose.imaging.internal.oi.m] (value [com.aspose.imaging.internal.oi.m@4b3b044f]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
31-Oct-2025 22:58:53.972 SEVERE [main] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [ROOT] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@49b15bf6]) and a value of type [com.aspose.imaging.internal.nq.g] (value [com.aspose.imaging.internal.nq.g@1642ae82]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
31-Oct-2025 22:58:53.972 SEVERE [main] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [ROOT] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@4d742035]) and a value of type [com.aspose.imaging.system.Threading.Thread] (value [com.aspose.imaging.system.Threading.Thread@6f5467ac]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
31-Oct-2025 22:58:53.972 SEVERE [main] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [ROOT] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@95e3b93]) and a value of type [com.aspose.imaging.internal.oi.m] (value [com.aspose.imaging.internal.oi.m@6d07d713]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
31-Oct-2025 22:58:53.972 SEVERE [main] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [ROOT] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@49b15bf6]) and a value of type [com.aspose.imaging.internal.nq.g] (value [com.aspose.imaging.internal.nq.g@2d98b386]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
31-Oct-2025 22:58:53.972 SEVERE [main] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [ROOT] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@4d742035]) and a value of type [com.aspose.imaging.system.Threading.Thread] (value [com.aspose.imaging.system.Threading.Thread@2ad63b2]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
31-Oct-2025 22:58:53.972 SEVERE [main] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [ROOT] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@95e3b93]) and a value of type [com.aspose.imaging.internal.oi.m] (value [com.aspose.imaging.internal.oi.m@657b414b]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
31-Oct-2025 22:58:53.973 SEVERE [main] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [ROOT] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@49b15bf6]) and a value of type [com.aspose.imaging.internal.nq.g] (value [com.aspose.imaging.internal.nq.g@51f0af4f]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
31-Oct-2025 22:58:53.973 SEVERE [main] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [ROOT] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@4d742035]) and a value of type [com.aspose.imaging.system.Threading.Thread] (value [com.aspose.imaging.system.Threading.Thread@5da55e25]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
31-Oct-2025 22:58:53.973 SEVERE [main] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [ROOT] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@95e3b93]) and a value of type [com.aspose.imaging.internal.oi.m] (value [com.aspose.imaging.internal.oi.m@7e7d4ff5]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
31-Oct-2025 22:58:53.973 SEVERE [main] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [ROOT] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@49b15bf6]) and a value of type [com.aspose.imaging.internal.nq.g] (value [com.aspose.imaging.internal.nq.g@325f3a06]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
31-Oct-2025 22:58:53.973 SEVERE [main] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [ROOT] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@4d742035]) and a value of type [com.aspose.imaging.system.Threading.Thread] (value [com.aspose.imaging.system.Threading.Thread@14e11cb7]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
31-Oct-2025 22:58:53.974 SEVERE [main] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [ROOT] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@95e3b93]) and a value of type [com.aspose.imaging.internal.oi.m] (value [com.aspose.imaging.internal.oi.m@7afbb6aa]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
31-Oct-2025 22:58:53.974 SEVERE [main] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [ROOT] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@49b15bf6]) and a value of type [com.aspose.imaging.internal.nq.g] (value [com.aspose.imaging.internal.nq.g@59e69a43]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
31-Oct-2025 22:58:53.974 SEVERE [main] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [ROOT] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@4d742035]) and a value of type [com.aspose.imaging.system.Threading.Thread] (value [com.aspose.imaging.system.Threading.Thread@36d405a8]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
31-Oct-2025 22:58:53.974 SEVERE [main] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [ROOT] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@95e3b93]) and a value of type [com.aspose.imaging.internal.oi.m] (value [com.aspose.imaging.internal.oi.m@6fd00647]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
31-Oct-2025 22:58:53.974 SEVERE [main] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [ROOT] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@49b15bf6]) and a value of type [com.aspose.imaging.internal.nq.g] (value [com.aspose.imaging.internal.nq.g@500d1d9]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
31-Oct-2025 22:58:53.975 SEVERE [main] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [ROOT] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@4d742035]) and a value of type [com.aspose.imaging.system.Threading.Thread] (value [com.aspose.imaging.system.Threading.Thread@25cd8307]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
31-Oct-2025 22:58:53.975 SEVERE [main] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [ROOT] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@95e3b93]) and a value of type [com.aspose.imaging.internal.oi.m] (value [com.aspose.imaging.internal.oi.m@4ebdabb6]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
31-Oct-2025 22:58:53.975 SEVERE [main] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [ROOT] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@49b15bf6]) and a value of type [com.aspose.imaging.internal.nq.g] (value [com.aspose.imaging.internal.nq.g@4f185b5d]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
31-Oct-2025 22:58:53.975 SEVERE [main] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [ROOT] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@4d742035]) and a value of type [com.aspose.imaging.system.Threading.Thread] (value [com.aspose.imaging.system.Threading.Thread@2009921f]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
31-Oct-2025 22:58:53.975 SEVERE [main] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [ROOT] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@95e3b93]) and a value of type [com.aspose.imaging.internal.oi.m] (value [com.aspose.imaging.internal.oi.m@accf78c]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
31-Oct-2025 22:58:53.976 SEVERE [main] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [ROOT] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@49b15bf6]) and a value of type [com.aspose.imaging.internal.nq.g] (value [com.aspose.imaging.internal.nq.g@36edbb99]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
31-Oct-2025 22:58:53.976 SEVERE [main] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [ROOT] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@4d742035]) and a value of type [com.aspose.imaging.system.Threading.Thread] (value [com.aspose.imaging.system.Threading.Thread@40dcfef3]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
31-Oct-2025 22:58:53.976 SEVERE [main] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [ROOT] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@95e3b93]) and a value of type [com.aspose.imaging.internal.oi.m] (value [com.aspose.imaging.internal.oi.m@32b911e]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
31-Oct-2025 22:58:53.977 SEVERE [main] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [ROOT] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@49b15bf6]) and a value of type [com.aspose.imaging.internal.nq.g] (value [com.aspose.imaging.internal.nq.g@121e7f7]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
31-Oct-2025 22:58:53.977 SEVERE [main] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [ROOT] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@4d742035]) and a value of type [com.aspose.imaging.system.Threading.Thread] (value [com.aspose.imaging.system.Threading.Thread@80d9116]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
31-Oct-2025 22:58:53.977 SEVERE [main] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [ROOT] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@95e3b93]) and a value of type [com.aspose.imaging.internal.oi.m] (value [com.aspose.imaging.internal.oi.m@4d0e17ed]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
31-Oct-2025 22:58:53.977 SEVERE [main] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [ROOT] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@49b15bf6]) and a value of type [com.aspose.imaging.internal.nq.g] (value [com.aspose.imaging.internal.nq.g@740f7490]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
31-Oct-2025 22:58:53.978 SEVERE [main] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [ROOT] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@4d742035]) and a value of type [com.aspose.imaging.system.Threading.Thread] (value [com.aspose.imaging.system.Threading.Thread@785dad71]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
31-Oct-2025 22:58:53.978 SEVERE [main] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [ROOT] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@95e3b93]) and a value of type [com.aspose.imaging.internal.oi.m] (value [com.aspose.imaging.internal.oi.m@11e487ee]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
31-Oct-2025 22:58:53.978 SEVERE [main] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [ROOT] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@49b15bf6]) and a value of type [com.aspose.imaging.internal.nq.g] (value [com.aspose.imaging.internal.nq.g@4a822518]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
31-Oct-2025 22:58:53.984 INFO [main] org.apache.coyote.AbstractProtocol.stop Stopping ProtocolHandler ["http-nio-8080"]
31-Oct-2025 22:58:53.988 INFO [main] org.apache.coyote.AbstractProtocol.destroy Destroying ProtocolHandler ["http-nio-8080"]
Disconnected from server
Эти ThreadLocal не дают мне покоя
Я начал исследовать эту проблему.
- Чем больше я совершу запросов к servelt, тем больше список.
- Я попробовал выполнить много запросов, а сервер остановить через длительный промежуток времени (8 часов), но список ни куда не делся, то есть ThreadLocal так и остался болтаться в памяти.
- Я посмотрел код библиотеки (на сколько это возможно при использованной мясорубке) и заметил одну особенность - не происходит вызова remove() над переменными типа ThreadLocal, разве что исключение составляет InterruptMonitor.setThreadLocalInstance(null)
Пожалуйста , поправьте меня если я не прав.
Даже если ключ удаляется (из-за слабой ссылки), значение остаётся привязанным к ThreadLocalMap , пока жив сам поток, а это очень опасно в серверных приложениях, где потоки могут существовать долгое время, полный раскардаш может начаться при использовании пула потоков. Все это содержит в себе Tomcat.
Я допускаю, что могу быть не правым и за ранее прошу прощения, за то что отрываю Вас по пустякам. Но для меня это критично, так как использование Вашего продукта предполагается как библиотека в web-приложении.