org.jvnet.hudson

## Class MemoryMonitor

- java.lang.Object
- - org.jvnet.hudson.MemoryMonitor

Direct Known Subclasses:
  Solaris, Windows

    public abstract class MemoryMonitor
    extends java.lang.Object

Encapsulates how to compute `MemoryUsage`.

Author:
  Kohsuke Kawaguchi

### Constructor Summary

Constructors
Constructor and Description
`MemoryMonitor()`

### Method Summary

Methods
`static MemoryMonitor` `get()` Obtains the `MemoryMonitor` implementation suitable for the current platform.
`static void` `main(java.lang.String[] args)` Main for test
`abstract MemoryUsage` `monitor()` Obtains the memory usage statistics.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### MemoryMonitor

    public MemoryMonitor()

### Method Detail

#### monitor

    public abstract MemoryUsage monitor()
                                 throws java.io.IOException

Obtains the memory usage statistics.

Returns:
  always non-null object.
Throws:
  `java.io.IOException` - If the computation fails for some reason.

#### get

    public static MemoryMonitor get()
                             throws java.io.IOException

Obtains the `MemoryMonitor` implementation suitable for the current platform.

Throws:
  `java.io.IOException` - if no applicable implementation is found.

#### main

    public static void main(java.lang.String[] args)
                     throws java.lang.Exception

Main for test

Throws:
  `java.lang.Exception`