All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cn.nukkit.plugin.js.JSJVMManager Maven / Gradle / Ivy

There is a newer version: 1.20.40-r1
Show newest version
package cn.nukkit.plugin.js;

import cn.nukkit.plugin.CommonJSPlugin;
import org.jetbrains.annotations.NotNull;

import java.lang.management.ManagementFactory;

@SuppressWarnings({"unused", "ClassCanBeRecord"})
public final class JSJVMManager {
    private final CommonJSPlugin jsPlugin;

    public JSJVMManager(CommonJSPlugin jsPlugin) {
        this.jsPlugin = jsPlugin;
    }

    @NotNull
    public String getJVMVersion() {
        var mxBean = ManagementFactory.getRuntimeMXBean();
        return mxBean.getVmName() + " " + mxBean.getVmVendor() + " " + mxBean.getVmVersion();
    }

    @NotNull
    public String getJITVersion() {
        var mxBean = ManagementFactory.getCompilationMXBean();
        return mxBean.getName();
    }

    public void gc() {
        System.gc();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy