File tree Expand file tree Collapse 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 Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -84,6 +84,11 @@ public String getOwner() {
8484		return  this .owner ;
8585	}
8686
87+ 	/** 
88+ 	 * Memory information. 
89+ 	 * 
90+ 	 * @since 3.4.0 
91+ 	 */ 
8792	public  static  class  MemoryInfo  {
8893
8994		private  static  final  MemoryMXBean  memoryMXBean  = ManagementFactory .getMemoryMXBean ();
Original file line number Diff line number Diff line change @@ -37,7 +37,11 @@ void processInfoIsAvailable() {
3737		assertThat (processInfo .getPid ()).isEqualTo (ProcessHandle .current ().pid ());
3838		assertThat (processInfo .getParentPid ())
3939			.isEqualTo (ProcessHandle .current ().parent ().map (ProcessHandle ::pid ).orElse (null ));
40+ 	}
4041
42+ 	@ Test 
43+ 	void  memoryInfoIsAvailable () {
44+ 		ProcessInfo  processInfo  = new  ProcessInfo ();
4145		MemoryUsageInfo  heapUsageInfo  = processInfo .getMemory ().getHeap ();
4246		MemoryUsageInfo  nonHeapUsageInfo  = processInfo .getMemory ().getNonHeap ();
4347		assertThat (heapUsageInfo .getInit ()).isPositive ().isLessThanOrEqualTo (heapUsageInfo .getMax ());
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments