com.hazelcast.memory

## Class DefaultMemoryStats

- java.lang.Object
- - com.hazelcast.memory.DefaultMemoryStats

- All Implemented Interfaces:
    MemoryStats

      public class DefaultMemoryStats
      extends Object
      implements MemoryStats

  Default implementation of MemoryStats.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultMemoryStats()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `long` | `getCommittedHeap()` Returns the amount of memory in bytes that is committed for the Java virtual machine to use.
    `long` | `getCommittedNative()` Returns the amount of native memory in bytes that is committed for current HazelcastInstance to use.
    `long` | `getFreeHeap()` Returns the amount of free memory in the JVM in bytes.
    `long` | `getFreeNative()` Returns the amount of free native memory in current HazelcastInstance in bytes.
    `long` | `getFreePhysical()` Returns free physical memory available in OS.
    `GarbageCollectorStats` | `getGCStats()` Returns the garbage collector statistics for the JVM
    `long` | `getMaxHeap()` Returns the maximum amount of memory that the JVM will attempt to use in bytes.
    `long` | `getMaxMetadata()` Returns the amount of native memory reserved for metadata.
    `long` | `getMaxNative()` Returns the maximum amount of native memory that current HazelcastInstance will attempt to use in bytes.
    `long` | `getTotalPhysical()` Returns total physical memory available in OS.
    `long` | `getUsedHeap()` Returns the amount of used memory in the JVM in bytes.
    `long` | `getUsedMetadata()`
    `long` | `getUsedNative()` Returns the amount of used native memory in current HazelcastInstance in bytes.
    `String` | `toString()`

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

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

- - ### Constructor Detail

    - #### DefaultMemoryStats

          public DefaultMemoryStats()

  - ### Method Detail

    - #### getTotalPhysical

          public final long getTotalPhysical()

      Description copied from interface: `MemoryStats`
      Returns total physical memory available in OS.
      Specified by:
        `getTotalPhysical` in interface `MemoryStats`
      Returns:
        total physical memory in bytes.

    - #### getFreePhysical

          public final long getFreePhysical()

      Description copied from interface: `MemoryStats`
      Returns free physical memory available in OS.

      Some operating systems have cached memory regions in which they store hot cached resources like files. Cached memory is used for allocations when required. So although this cached region is assumed as free, operating systems generally report this region as used not free.
      Specified by:
        `getFreePhysical` in interface `MemoryStats`
      Returns:
        free physical memory in bytes.

    - #### getMaxHeap

          public final long getMaxHeap()

      Description copied from interface: `MemoryStats`
      Returns the maximum amount of memory that the JVM will attempt to use in bytes.
      Specified by:
        `getMaxHeap` in interface `MemoryStats`
      Returns:
        the maximum amount of memory in bytes.
      See Also:
        `Runtime.maxMemory()`

    - #### getCommittedHeap

          public final long getCommittedHeap()

      Description copied from interface: `MemoryStats`
      Returns the amount of memory in bytes that is committed for the Java virtual machine to use.
      Specified by:
        `getCommittedHeap` in interface `MemoryStats`
      Returns:
        the amount of committed memory in bytes.
      See Also:
        `Runtime.totalMemory()`, `MemoryUsage.getCommitted()`

    - #### getUsedHeap

          public final long getUsedHeap()

      Description copied from interface: `MemoryStats`
      Returns the amount of used memory in the JVM in bytes.
      Specified by:
        `getUsedHeap` in interface `MemoryStats`
      Returns:
        the amount of used memory in bytes
      See Also:
        `MemoryUsage.getUsed()`

    - #### getFreeHeap

          public final long getFreeHeap()

      Description copied from interface: `MemoryStats`
      Returns the amount of free memory in the JVM in bytes.
      Specified by:
        `getFreeHeap` in interface `MemoryStats`
      Returns:
        the amount of free memory in bytes
      See Also:
        `Runtime.freeMemory()`

    - #### getMaxNative

          public long getMaxNative()

      Description copied from interface: `MemoryStats`
      Returns the maximum amount of native memory that current HazelcastInstance will attempt to use in bytes.
      Specified by:
        `getMaxNative` in interface `MemoryStats`
      Returns:
        the maximum amount of native memory in bytes.

    - #### getCommittedNative

          public long getCommittedNative()

      Description copied from interface: `MemoryStats`
      Returns the amount of native memory in bytes that is committed for current HazelcastInstance to use.
      Specified by:
        `getCommittedNative` in interface `MemoryStats`
      Returns:
        the amount of committed native memory in bytes.

    - #### getUsedNative

          public long getUsedNative()

      Description copied from interface: `MemoryStats`
      Returns the amount of used native memory in current HazelcastInstance in bytes.
      Specified by:
        `getUsedNative` in interface `MemoryStats`
      Returns:
        the amount of used native memory in bytes

    - #### getFreeNative

          public long getFreeNative()

      Description copied from interface: `MemoryStats`
      Returns the amount of free native memory in current HazelcastInstance in bytes.
      Specified by:
        `getFreeNative` in interface `MemoryStats`
      Returns:
        the amount of free native memory in bytes

    - #### getMaxMetadata

          public long getMaxMetadata()

      Description copied from interface: `MemoryStats`
      Returns the amount of native memory reserved for metadata. This memory is separate and not accounted for by the `...NativeMemory` statistics.
      Specified by:
        `getMaxMetadata` in interface `MemoryStats`

    - #### getUsedMetadata

          public long getUsedMetadata()

      Specified by:
        `getUsedMetadata` in interface `MemoryStats`
      Returns:
        amount of used metadata memory

    - #### getGCStats

          public GarbageCollectorStats getGCStats()

      Description copied from interface: `MemoryStats`
      Returns the garbage collector statistics for the JVM
      Specified by:
        `getGCStats` in interface `MemoryStats`
      Returns:
        GC statistics

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2019. All rights reserved.