1
0
mirror of https://e.coding.net/circlecloud/CTZServer.git synced 2024-12-27 17:18:47 +00:00

add lose file...

Signed-off-by: j502647092 <jtb1@163.com>
This commit is contained in:
j502647092 2015-09-13 21:48:13 +08:00
parent 3301d2b7bf
commit 3a1abb4301

View File

@ -0,0 +1,41 @@
package cn.citycraft.CTZServer.commands;
import cn.citycraft.CTZServer.CTZServer;
import cn.citycraft.CTZServer.ServerThread;
import cn.citycraft.utils.StringUtil;
import net.md_5.bungee.api.ChatColor;
public class CommandGc extends BaseCommand {
ServerThread serverThread;
public CommandGc(ServerThread serverThread) {
super("gc", "mem");
this.serverThread = serverThread;
}
@Override
public void execute(String label, String[] args) {
Runtime rt = Runtime.getRuntime();
if (label.equalsIgnoreCase("gc"))
rt.gc();
CTZServer.print("最大内存: " + StringUtil.b2mb(rt.maxMemory()));
CTZServer.print("使用内存: " + StringUtil.b2mb(rt.totalMemory()));
CTZServer.print("空闲内存: " + StringUtil.b2mb(rt.freeMemory()));
}
@Override
public String getDescription() {
return ChatColor.GREEN + "查看服务器内存占用";
}
@Override
public int getMinimumArguments() {
return 0;
}
@Override
public String getPossibleArguments() {
return "";
}
}