测试算法使用内存临时提交
This commit is contained in:
@@ -120,6 +120,23 @@ public class InfluxdbDataVImpl extends MppServiceImpl<RStatDataVRelationMapper,
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<DataVDto> getRawData(LineCountEvaluateParam lineParam) {
|
public List<DataVDto> 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<DataVDto> result = new ArrayList<>();
|
List<DataVDto> result = new ArrayList<>();
|
||||||
List<DataV> list = getMinuteDataV(lineParam);
|
List<DataV> list = getMinuteDataV(lineParam);
|
||||||
list.forEach(item -> {
|
list.forEach(item -> {
|
||||||
@@ -434,7 +451,7 @@ public class InfluxdbDataVImpl extends MppServiceImpl<RStatDataVRelationMapper,
|
|||||||
System.out.println("当前已分配的内存: " + totalMemory / (1024 * 1024) + " MB");
|
System.out.println("当前已分配的内存: " + totalMemory / (1024 * 1024) + " MB");
|
||||||
System.out.println("当前空闲内存: " + freeMemory / (1024 * 1024) + " MB");
|
System.out.println("当前空闲内存: " + freeMemory / (1024 * 1024) + " MB");
|
||||||
System.out.println("已使用的内存: " + usedMemory / (1024 * 1024) + " MB");
|
System.out.println("已使用的内存: " + usedMemory / (1024 * 1024) + " MB");
|
||||||
System.out.println("第二次分析结束-----------------------------------------");
|
System.out.println("dataprocess第二次分析结束-----------------------------------------");
|
||||||
|
|
||||||
if (CollUtil.isNotEmpty(list)) {
|
if (CollUtil.isNotEmpty(list)) {
|
||||||
Map<String, List<DataV>> lineMap = list.stream().collect(Collectors.groupingBy(DataV::getLineId));
|
Map<String, List<DataV>> lineMap = list.stream().collect(Collectors.groupingBy(DataV::getLineId));
|
||||||
|
|||||||
Reference in New Issue
Block a user