mirror of
https://github.com/zfile-dev/zfile.git
synced 2025-04-19 05:34:52 +00:00
40 lines
670 B
Java
40 lines
670 B
Java
package im.zhaojun.common.model;
|
|
|
|
import lombok.Data;
|
|
|
|
/**
|
|
* @author zhaojun
|
|
*/
|
|
@Data
|
|
public class Jvm {
|
|
|
|
/**
|
|
* 当前 JVM 占用的内存总数 (M)
|
|
*/
|
|
private double total;
|
|
|
|
/**
|
|
* JVM 最大可用内存总数 (M)
|
|
*/
|
|
private double max;
|
|
|
|
/**
|
|
* JVM 空闲内存 (M)
|
|
*/
|
|
private double free;
|
|
|
|
/**
|
|
* JDK 版本
|
|
*/
|
|
private String version;
|
|
|
|
public Jvm() {
|
|
Runtime runtime = Runtime.getRuntime();
|
|
this.total = runtime.totalMemory();
|
|
this.free = runtime.freeMemory();
|
|
this.max = runtime.maxMemory();
|
|
this.version = System.getProperty("java.version");
|
|
}
|
|
|
|
}
|