From 20d1489fe968a3c42bf0c5d3be5f3d2be9ca6e25 Mon Sep 17 00:00:00 2001 From: chendaofei <857448963@qq.com> Date: Mon, 7 Apr 2025 11:32:56 +0800 Subject: [PATCH] =?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../serviceimpl/line/DataCleanServiceImpl.java | 17 +++++++++++++++++ .../src/main/resources/bootstrap.yml | 2 ++ .../event-boot/src/main/resources/bootstrap.yml | 2 +- .../rt/rt-boot/src/main/resources/bootstrap.yml | 2 +- .../src/main/resources/bootstrap.yml | 2 ++ 5 files changed, 23 insertions(+), 2 deletions(-) diff --git a/algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/serviceimpl/line/DataCleanServiceImpl.java b/algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/serviceimpl/line/DataCleanServiceImpl.java index 720c846..58e1b67 100644 --- a/algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/serviceimpl/line/DataCleanServiceImpl.java +++ b/algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/serviceimpl/line/DataCleanServiceImpl.java @@ -69,6 +69,23 @@ public class DataCleanServiceImpl implements IDataCleanService { @Override public void dataVCleanHandler(CalculatedParam calculatedParam) { + Runtime runtime = Runtime.getRuntime(); + // 获取 JVM 最大可用内存(以字节为单位) + long maxMemory = runtime.maxMemory(); + // 获取 JVM 当前已分配的内存(以字节为单位) + long totalMemory = runtime.totalMemory(); + // 获取 JVM 当前空闲内存(以字节为单位) + long freeMemory = runtime.freeMemory(); + // 计算已使用的内存 + long usedMemory = totalMemory - freeMemory; + + System.out.println("最大可用内存: " + maxMemory / (1024 * 1024) + " MB"); + System.out.println("当前已分配的内存: " + totalMemory / (1024 * 1024) + " MB"); + System.out.println("当前空闲内存: " + freeMemory / (1024 * 1024) + " MB"); + System.out.println("已使用的内存: " + usedMemory / (1024 * 1024) + " MB"); + System.out.println("第一次分析结束-----------------------------------------"); + + logger.info("{},dataV表异常数据算法执行=====》", LocalDateTime.now()); List result = new ArrayList<>(); //获取标准 diff --git a/algorithm/algorithm-boot/src/main/resources/bootstrap.yml b/algorithm/algorithm-boot/src/main/resources/bootstrap.yml index 6d0bdba..152a842 100644 --- a/algorithm/algorithm-boot/src/main/resources/bootstrap.yml +++ b/algorithm/algorithm-boot/src/main/resources/bootstrap.yml @@ -31,6 +31,8 @@ spring: refresh: true - data-Id: share-config-datasource-db.yaml refresh: true + - data-Id: data-platform.yaml + refresh: true main: allow-bean-definition-overriding: true diff --git a/analysis/event/event-boot/src/main/resources/bootstrap.yml b/analysis/event/event-boot/src/main/resources/bootstrap.yml index 1964979..2a90fcb 100644 --- a/analysis/event/event-boot/src/main/resources/bootstrap.yml +++ b/analysis/event/event-boot/src/main/resources/bootstrap.yml @@ -29,7 +29,7 @@ spring: shared-configs: - data-id: share-config.yaml refresh: true - - data-Id: data-platform.yaml + - data-Id: share-config-datasource-db.yaml refresh: true main: allow-bean-definition-overriding: true diff --git a/analysis/rt/rt-boot/src/main/resources/bootstrap.yml b/analysis/rt/rt-boot/src/main/resources/bootstrap.yml index 4e273c4..b919c3f 100644 --- a/analysis/rt/rt-boot/src/main/resources/bootstrap.yml +++ b/analysis/rt/rt-boot/src/main/resources/bootstrap.yml @@ -29,7 +29,7 @@ spring: shared-configs: - data-id: share-config.yaml refresh: true - - data-Id: algorithm-config.yaml + - data-Id: share-config-datasource-db.yaml refresh: true main: allow-bean-definition-overriding: true diff --git a/data-processing/data-processing-boot/src/main/resources/bootstrap.yml b/data-processing/data-processing-boot/src/main/resources/bootstrap.yml index c32d6f1..69fc72b 100644 --- a/data-processing/data-processing-boot/src/main/resources/bootstrap.yml +++ b/data-processing/data-processing-boot/src/main/resources/bootstrap.yml @@ -30,6 +30,8 @@ spring: shared-configs: - data-id: share-config.yaml refresh: true + - data-Id: share-config-datasource-db.yaml + refresh: true - data-Id: data-platform.yaml refresh: true main: