If you don’t actively close the thread pool, there will be some dormant threads in the pool, which will usually be shut down after 1 minute. So if a thread pool is used in a web project, it is best to turn off the initialized thread pool in the ServletContextListener.destroy method, usually using shutdown() 或 shutdownNow() ,如果做得完善些,可以再加上 awaitTermination such processing.
If you don’t actively close the thread pool, there will be some dormant threads in the pool, which will usually be shut down after 1 minute.
So if a thread pool is used in a web project, it is best to turn off the initialized thread pool in the ServletContextListener.destroy method, usually using
shutdown()
或shutdownNow()
,如果做得完善些,可以再加上awaitTermination
such processing.