sts开启服务器后直接关闭是正常的,一旦中间有了数据库的操作之后,在关闭就会提示两个警告,MySQL Statement Cancellation Timer和HikariPool-1 housekeeper的线程没有关闭。
The web application [ROOT] appears to have started a thread named [HikariPool-1 housekeeper] but has failed to stop it. This is very likely to create a memory leak.
java.base@17.0.7/jdk.internal.misc.Unsafe.park(Native Method)
java.base@17.0.7/java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:252)
java.base@17.0.7/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:1672) java.base@17.0.7/java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1182)
**java.base@17.0.7/java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:899)
java.base@17.0.7/java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1062)
java.base@17.0.7/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1122)
java.base@17.0.7/java.util.concurrent.ThreadPoolExecutor$**Worker.run(ThreadPoolExecutor.java:635)
The web application [ROOT] appears to have started a thread named [MySQL Statement Cancellation Timer] but has failed to stop it. This is very likely to create a memory leak.
java.base@17.0.7/java.lang.Object.wait(Native Method)
java.base@17.0.7/java.util.TimerThread.mainLoop(Timer.java:563)
java.base@17.0.7/java.util.TimerThread.run(Timer.java:516)
我只用了这些,没有额外用别的连接池,tomcat是sts自己带的
自学的,不知道描述的是不是清楚, 这个怎么办呢?