📄 memorycommand.java
字号:
/*
* $Id: MemoryCommand.java,v 1.2 2004/02/20 08:19:32 epr Exp $
*/
package org.jnode.shell.command;
import java.io.InputStream;
import java.io.PrintStream;
import org.jnode.shell.CommandLine;
import org.jnode.shell.help.Help;
/**
* @author Ewout Prangsma (epr@users.sourceforge.net)
*/
public class MemoryCommand {
public static Help.Info HELP_INFO = new Help.Info("memory", "View the current memory status");
public static void main(String[] args) throws Exception {
new MemoryCommand().execute(new CommandLine(args), System.in, System.out, System.err);
}
/**
* Execute this command
*/
public void execute(CommandLine cmdLine, InputStream in, PrintStream out, PrintStream err) throws Exception {
final Runtime rt = Runtime.getRuntime();
out.println("Total memory " + rt.totalMemory());
out.println("Used memory " + (rt.totalMemory() - rt.freeMemory()));
out.println("Free memory " + rt.freeMemory());
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -