import java.lang.management.*;
import com.sun.management.*;
import java.util.*;

public class B
{
    public static void main(String[] arg) throws Exception {
        Thread t = new Thread() {
            public void run() {
                Random r = new Random();
                for (;;) {
                    r.nextInt();
                }
            }
        };
        t.start();
        Thread t2 = new Thread() {
            public void run() {
                Random r = new Random();
                for (;;) {
                    r.nextInt();
                }
            }
        };
        t2.start();
        com.sun.management.OperatingSystemMXBean os = (com.sun.management.OperatingSystemMXBean) ManagementFactory.getOperatingSystemMXBean();
        for (;;) {
            System.out.println("total swap space  : "+os.getTotalSwapSpaceSize());
            System.out.println("free swap space   : "+os.getFreeSwapSpaceSize());
            System.out.println();
            System.out.println("committed virt mem: "+os.getCommittedVirtualMemorySize());
            System.out.println("process cpu time  : "+os.getProcessCpuTime());
            System.out.println();
            System.out.println("total phys mem    : "+os.getTotalPhysicalMemorySize());
            System.out.println("free phys mem     : "+os.getFreePhysicalMemorySize());
            System.out.println();
            System.out.println("system cpu load   : "+os.getSystemCpuLoad());
            System.out.println("process cpu lo    : "+os.getProcessCpuLoad());
            System.out.println();
            System.out.println("open files        : "+((UnixOperatingSystemMXBean)os).getOpenFileDescriptorCount());
            System.out.println("max files         : "+((UnixOperatingSystemMXBean)os).getMaxFileDescriptorCount());
            System.out.println("---");
            Thread.sleep(1000);
        }
    }
}
