File tree 2 files changed +9
-0
lines changed
spring-boot-project/spring-boot/src
main/java/org/springframework/boot/info
test/java/org/springframework/boot/info 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -84,6 +84,11 @@ public String getOwner() {
84
84
return this .owner ;
85
85
}
86
86
87
+ /**
88
+ * Memory information.
89
+ *
90
+ * @since 3.4.0
91
+ */
87
92
public static class MemoryInfo {
88
93
89
94
private static final MemoryMXBean memoryMXBean = ManagementFactory .getMemoryMXBean ();
Original file line number Diff line number Diff line change @@ -37,7 +37,11 @@ void processInfoIsAvailable() {
37
37
assertThat (processInfo .getPid ()).isEqualTo (ProcessHandle .current ().pid ());
38
38
assertThat (processInfo .getParentPid ())
39
39
.isEqualTo (ProcessHandle .current ().parent ().map (ProcessHandle ::pid ).orElse (null ));
40
+ }
40
41
42
+ @ Test
43
+ void memoryInfoIsAvailable () {
44
+ ProcessInfo processInfo = new ProcessInfo ();
41
45
MemoryUsageInfo heapUsageInfo = processInfo .getMemory ().getHeap ();
42
46
MemoryUsageInfo nonHeapUsageInfo = processInfo .getMemory ().getNonHeap ();
43
47
assertThat (heapUsageInfo .getInit ()).isPositive ().isLessThanOrEqualTo (heapUsageInfo .getMax ());
You can’t perform that action at this time.
0 commit comments