diff --git a/aio-core/src/main/java/org/smartboot/socket/buffer/BufferPagePool.java b/aio-core/src/main/java/org/smartboot/socket/buffer/BufferPagePool.java index 48acd5bb483ba911330b698b778d8cd014830b22..cede295376f18b6b1831d9990a22910e11cc596f 100644 --- a/aio-core/src/main/java/org/smartboot/socket/buffer/BufferPagePool.java +++ b/aio-core/src/main/java/org/smartboot/socket/buffer/BufferPagePool.java @@ -116,5 +116,13 @@ public final class BufferPagePool { }, 500, 1000, TimeUnit.MILLISECONDS); + /** + * 关闭资源 + * weiwei + * 2023年4月17日17:19:07 + */ + public void shutdown(){ + BUFFER_POOL_CLEAN.shutdown(); + } } diff --git a/aio-core/src/main/java/org/smartboot/socket/transport/AioQuickServer.java b/aio-core/src/main/java/org/smartboot/socket/transport/AioQuickServer.java index 83c1f384b4ef829092881c0d68857b3381874c5d..0cba685a4ce96229803390b50f2bca4d6df51399 100644 --- a/aio-core/src/main/java/org/smartboot/socket/transport/AioQuickServer.java +++ b/aio-core/src/main/java/org/smartboot/socket/transport/AioQuickServer.java @@ -245,6 +245,8 @@ public final class AioQuickServer { } if (innerBufferPool != null) { innerBufferPool.release(); + //关闭守护线程在空闲时期回收内存资源线程 + innerBufferPool.shutdown(); } } diff --git a/aio-pro/src/main/java/org/smartboot/socket/transport/UdpBootstrap.java b/aio-pro/src/main/java/org/smartboot/socket/transport/UdpBootstrap.java index 818c17aeff5b792f1bba19b033bf72e38382cc61..23b2190244165409108f4bf35629f7f54f063196 100644 --- a/aio-pro/src/main/java/org/smartboot/socket/transport/UdpBootstrap.java +++ b/aio-pro/src/main/java/org/smartboot/socket/transport/UdpBootstrap.java @@ -115,6 +115,8 @@ public class UdpBootstrap { } if (innerBufferPool != null) { innerBufferPool.release(); + //关闭守护线程在空闲时期回收内存资源线程 + innerBufferPool.shutdown(); } }