diff --git a/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/influxdb/InfluxdbDataVImpl.java b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/influxdb/InfluxdbDataVImpl.java index 9f0b987..1e2f3a5 100644 --- a/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/influxdb/InfluxdbDataVImpl.java +++ b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/influxdb/InfluxdbDataVImpl.java @@ -120,6 +120,23 @@ public class InfluxdbDataVImpl extends MppServiceImpl getRawData(LineCountEvaluateParam lineParam) { + + 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("dataprocess第一次分析结束-----------------------------------------"); + List result = new ArrayList<>(); List list = getMinuteDataV(lineParam); list.forEach(item -> { @@ -434,7 +451,7 @@ public class InfluxdbDataVImpl extends MppServiceImpl> lineMap = list.stream().collect(Collectors.groupingBy(DataV::getLineId));