Search in sources :

Example 1 with RamInstance

use of com.kahzerx.kahzerxmod.profiler.instances.RamInstance in project KahzerxMod by otakucraft.

the class RamProfiler method onTick.

@Override
public void onTick(MinecraftServer server, String id) {
    Runtime runtime = Runtime.getRuntime();
    long maxMemory = runtime.maxMemory() / 1024 / 1024 / 1024;
    long allocatedMemory = runtime.totalMemory() / 1024 / 1024 / 1024;
    long freeMemory = runtime.freeMemory() / 1024 / 1024 / 1024;
    this.addResult(server.getTicks(), new ProfilerResult("ram", id, new RamInstance((double) maxMemory, (double) allocatedMemory, (double) freeMemory)));
}
Also used : RamInstance(com.kahzerx.kahzerxmod.profiler.instances.RamInstance) ProfilerResult(com.kahzerx.kahzerxmod.profiler.instances.ProfilerResult)

Aggregations

ProfilerResult (com.kahzerx.kahzerxmod.profiler.instances.ProfilerResult)1 RamInstance (com.kahzerx.kahzerxmod.profiler.instances.RamInstance)1