com.hazelcast.memory
Class DefaultMemoryStats

java.lang.Object
  extended by com.hazelcast.memory.DefaultMemoryStats
All Implemented Interfaces:
MemoryStats

public class DefaultMemoryStats
extends Object
implements MemoryStats

Default implementation of MemoryStats.


Constructor Summary
DefaultMemoryStats()
           
 
Method Summary
 long getCommittedHeap()
          Returns the amount of memory in bytes that is committed for the Java virtual machine to use.
 long getCommittedNativeMemory()
          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 getFreeNativeMemory()
          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 getMaxNativeMemory()
          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 getUsedNativeMemory()
          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()

getMaxNativeMemory

public long getMaxNativeMemory()
Description copied from interface: MemoryStats
Returns the maximum amount of native memory that current HazelcastInstance will attempt to use in bytes.

Specified by:
getMaxNativeMemory in interface MemoryStats
Returns:
the maximum amount of native memory in bytes.

getCommittedNativeMemory

public long getCommittedNativeMemory()
Description copied from interface: MemoryStats
Returns the amount of native memory in bytes that is committed for current HazelcastInstance to use.

Specified by:
getCommittedNativeMemory in interface MemoryStats
Returns:
the amount of committed native memory in bytes.

getUsedNativeMemory

public long getUsedNativeMemory()
Description copied from interface: MemoryStats
Returns the amount of used native memory in current HazelcastInstance in bytes.

Specified by:
getUsedNativeMemory in interface MemoryStats
Returns:
the amount of used native memory in bytes

getFreeNativeMemory

public long getFreeNativeMemory()
Description copied from interface: MemoryStats
Returns the amount of free native memory in current HazelcastInstance in bytes.

Specified by:
getFreeNativeMemory in interface MemoryStats
Returns:
the amount of free native memory in bytes

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 © 2015 Hazelcast, Inc.. All Rights Reserved.