|
|
|
@ -1,5 +1,5 @@ |
|
|
|
/* |
|
|
|
/* |
|
|
|
* Copyright 2012-2024 the original author or authors. |
|
|
|
* Copyright 2012-2025 the original author or authors. |
|
|
|
* |
|
|
|
* |
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
|
|
* you may not use this file except in compliance with the License. |
|
|
|
* you may not use this file except in compliance with the License. |
|
|
|
@ -43,13 +43,13 @@ class ProcessInfoTests { |
|
|
|
void memoryInfoIsAvailable() { |
|
|
|
void memoryInfoIsAvailable() { |
|
|
|
ProcessInfo processInfo = new ProcessInfo(); |
|
|
|
ProcessInfo processInfo = new ProcessInfo(); |
|
|
|
MemoryUsageInfo heapUsageInfo = processInfo.getMemory().getHeap(); |
|
|
|
MemoryUsageInfo heapUsageInfo = processInfo.getMemory().getHeap(); |
|
|
|
MemoryUsageInfo nonHeapUsageInfo = processInfo.getMemory().getNonHeap(); |
|
|
|
|
|
|
|
assertThat(heapUsageInfo.getInit()).isPositive().isLessThanOrEqualTo(heapUsageInfo.getMax()); |
|
|
|
assertThat(heapUsageInfo.getInit()).isPositive().isLessThanOrEqualTo(heapUsageInfo.getMax()); |
|
|
|
assertThat(heapUsageInfo.getUsed()).isPositive().isLessThanOrEqualTo(heapUsageInfo.getCommitted()); |
|
|
|
assertThat(heapUsageInfo.getUsed()).isPositive().isLessThanOrEqualTo(heapUsageInfo.getCommitted()); |
|
|
|
assertThat(heapUsageInfo.getCommitted()).isPositive().isLessThanOrEqualTo(heapUsageInfo.getMax()); |
|
|
|
assertThat(heapUsageInfo.getCommitted()).isPositive().isLessThanOrEqualTo(heapUsageInfo.getMax()); |
|
|
|
assertThat(heapUsageInfo.getMax()).isPositive(); |
|
|
|
assertThat(heapUsageInfo.getMax()).isPositive(); |
|
|
|
|
|
|
|
MemoryUsageInfo nonHeapUsageInfo = processInfo.getMemory().getNonHeap(); |
|
|
|
assertThat(nonHeapUsageInfo.getInit()).isPositive(); |
|
|
|
assertThat(nonHeapUsageInfo.getInit()).isPositive(); |
|
|
|
assertThat(nonHeapUsageInfo.getUsed()).isPositive().isLessThanOrEqualTo(heapUsageInfo.getCommitted()); |
|
|
|
assertThat(nonHeapUsageInfo.getUsed()).isPositive().isLessThanOrEqualTo(nonHeapUsageInfo.getCommitted()); |
|
|
|
assertThat(nonHeapUsageInfo.getCommitted()).isPositive(); |
|
|
|
assertThat(nonHeapUsageInfo.getCommitted()).isPositive(); |
|
|
|
assertThat(nonHeapUsageInfo.getMax()).isEqualTo(-1); |
|
|
|
assertThat(nonHeapUsageInfo.getMax()).isEqualTo(-1); |
|
|
|
} |
|
|
|
} |
|
|
|
|