com.hazelcast.memory

## Interface MemoryStats

- All Known Subinterfaces:
    LocalMemoryStats
  All Known Implementing Classes:
    DefaultMemoryStats

      public interface MemoryStats

  Memory statistics for the JVM which current HazelcastInstance belongs to.

  Shows total physical/free OS memory, max/committed/used/free heap memory and max/committed/used/free native memory.
  See Also:
    `GarbageCollectorStats`

- - ### Method Summary

    All Methods Instance Methods Abstract 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.

- - ### Method Detail

    - #### getTotalPhysical

          long getTotalPhysical()

      Returns total physical memory available in OS.
      Returns:
        total physical memory in bytes.

    - #### getFreePhysical

          long getFreePhysical()

      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.
      Returns:
        free physical memory in bytes.

    - #### getMaxHeap

          long getMaxHeap()

      Returns the maximum amount of memory that the JVM will attempt to use in bytes.
      Returns:
        the maximum amount of memory in bytes.
      See Also:
        `Runtime.maxMemory()`

    - #### getCommittedHeap

          long getCommittedHeap()

      Returns the amount of memory in bytes that is committed for the Java virtual machine to use.
      Returns:
        the amount of committed memory in bytes.
      See Also:
        `Runtime.totalMemory()`, `MemoryUsage.getCommitted()`

    - #### getUsedHeap

          long getUsedHeap()

      Returns the amount of used memory in the JVM in bytes.
      Returns:
        the amount of used memory in bytes
      See Also:
        `MemoryUsage.getUsed()`

    - #### getFreeHeap

          long getFreeHeap()

      Returns the amount of free memory in the JVM in bytes.
      Returns:
        the amount of free memory in bytes
      See Also:
        `Runtime.freeMemory()`

    - #### getMaxNative

          long getMaxNative()

      Returns the maximum amount of native memory that current HazelcastInstance will attempt to use in bytes.
      Returns:
        the maximum amount of native memory in bytes.

    - #### getCommittedNative

          long getCommittedNative()

      Returns the amount of native memory in bytes that is committed for current HazelcastInstance to use.
      Returns:
        the amount of committed native memory in bytes.

    - #### getUsedNative

          long getUsedNative()

      Returns the amount of used native memory in current HazelcastInstance in bytes.
      Returns:
        the amount of used native memory in bytes

    - #### getFreeNative

          long getFreeNative()

      Returns the amount of free native memory in current HazelcastInstance in bytes.
      Returns:
        the amount of free native memory in bytes

    - #### getMaxMetadata

          long getMaxMetadata()

      Returns the amount of native memory reserved for metadata. This memory is separate and not accounted for by the `...NativeMemory` statistics.

    - #### getUsedMetadata

          long getUsedMetadata()

      Returns:
        amount of used metadata memory

    - #### getGCStats

          GarbageCollectorStats getGCStats()

      Returns the garbage collector statistics for the JVM
      Returns:
        GC statistics

Copyright © 2019. All rights reserved.