From 4cc2b647f5dff20093bbfc1655a3944f6fb19c2b Mon Sep 17 00:00:00 2001 From: w-wei <945324621@qq.com> Date: Mon, 17 Apr 2023 17:28:57 +0800 Subject: [PATCH] =?UTF-8?q?=20//=E5=85=B3=E9=97=AD=E5=AE=88=E6=8A=A4?= =?UTF-8?q?=E7=BA=BF=E7=A8=8B=E5=9C=A8=E7=A9=BA=E9=97=B2=E6=97=B6=E6=9C=9F?= =?UTF-8?q?=E5=9B=9E=E6=94=B6=E5=86=85=E5=AD=98=E8=B5=84=E6=BA=90=E7=BA=BF?= =?UTF-8?q?=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/org/smartboot/socket/buffer/BufferPagePool.java | 8 ++++++++ .../org/smartboot/socket/transport/AioQuickServer.java | 2 ++ .../java/org/smartboot/socket/transport/UdpBootstrap.java | 2 ++ 3 files changed, 12 insertions(+) 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 48acd5bb..cede2953 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 83c1f384..0cba685a 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 818c17ae..23b21902 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(); } } -- Gitee