com.atlassian.confluence.status.service.systeminfo
Class MemoryInfo

java.lang.Object
  extended by com.atlassian.confluence.status.service.systeminfo.MemoryInfo

public class MemoryInfo
extends java.lang.Object

Simple bean encapsulating information about the system's memory usage. The usage information is calculated when the bean is instantiated (and not recalculated after)


Nested Class Summary
static class MemoryInfo.Bytes
          Represents some number of bytes.
 
Constructor Summary
MemoryInfo()
          Construct a new MemoryInfo containing details of Confluence's memory usage at time of instantiation.
 
Method Summary
 MemoryInfo.Bytes getAllocatedHeap()
          Gets the amount of heap currently allocated by the JVM.
 MemoryInfo.Bytes getAvailableHeap()
          Gets the total heap still available to be used.
 MemoryInfo.Bytes getAvailablePermGen()
          Gets the currently available permanent generation memory.
 MemoryInfo.Bytes getFreeAllocatedHeap()
          Gets the amount of currently allocated heap that has not been used.
 long getFreeMemory()
          Deprecated. since 3.1 produces misleading memory info. Please use newer API
 long getFreeMemoryInMegabytes()
          Deprecated. since 3.1 produces misleading memory info. Please use newer API
 MemoryInfo.Bytes getMaxHeap()
          Gets the maximum amount of heap the JVM is will allow to be allocated.
 MemoryInfo.Bytes getMaxPermGen()
          Gets the maximum permanent generation memory allocation.
 long getTotalMemory()
          Deprecated. since 3.1 produces misleading memory statistics. Please use newer API
 long getTotalMemoryInMegabytes()
          Deprecated. since 3.1 produces misleading memory info. Please use newer API
 MemoryInfo.Bytes getUsedHeap()
          Gets the amount of heap currently used by the JVM.
 long getUsedMemory()
          Deprecated. since 3.1. Use getUsedHeap()
 long getUsedMemoryInMegabytes()
          Deprecated. since 3.1. Use getUsedHeap()
 MemoryInfo.Bytes getUsedPermGen()
          Gets the currently used permanent generation memory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MemoryInfo

public MemoryInfo()
Construct a new MemoryInfo containing details of Confluence's memory usage at time of instantiation.

Method Detail

getAvailableHeap

public MemoryInfo.Bytes getAvailableHeap()
Gets the total heap still available to be used. This includes heap that the JVM is configured to use but has not yet allocated. To most users this will be the "free" memory.

Returns:
get the total heap still available to be used

getFreeAllocatedHeap

public MemoryInfo.Bytes getFreeAllocatedHeap()
Gets the amount of currently allocated heap that has not been used. This is the value that Confluence used to report as "free memory".

Returns:
the amount of allocated heap that is not used

getMaxHeap

public MemoryInfo.Bytes getMaxHeap()
Gets the maximum amount of heap the JVM is will allow to be allocated. This should be close to (but probably not exactly the same as) the JVM's -Xmx setting.

Returns:
the maximum heap for the JVM, or -1 if there is no limit.

getAllocatedHeap

public MemoryInfo.Bytes getAllocatedHeap()
Gets the amount of heap currently allocated by the JVM. This is the value that Confluence used to report as "total memory".

Returns:
the amount of heap currently allocated by the JVM.

getUsedHeap

public MemoryInfo.Bytes getUsedHeap()
Gets the amount of heap currently used by the JVM.

Returns:
the amount of heap currently used by the JVM

getMaxPermGen

public MemoryInfo.Bytes getMaxPermGen()
Gets the maximum permanent generation memory allocation. This should be close to (or even the same as) the -XXMaxPermSize setting

Returns:
the maximum permanent generation size

getUsedPermGen

public MemoryInfo.Bytes getUsedPermGen()
Gets the currently used permanent generation memory.

Returns:
the currently used permanent generation memory.

getAvailablePermGen

public MemoryInfo.Bytes getAvailablePermGen()
Gets the currently available permanent generation memory.

Returns:
the available permanent generation memory.

getTotalMemory

public long getTotalMemory()
Deprecated. since 3.1 produces misleading memory statistics. Please use newer API

See Also:
getMaxHeap(), getAllocatedHeap()

getTotalMemoryInMegabytes

public long getTotalMemoryInMegabytes()
Deprecated. since 3.1 produces misleading memory info. Please use newer API

See Also:
getMaxHeap(), getAllocatedHeap()

getFreeMemory

public long getFreeMemory()
Deprecated. since 3.1 produces misleading memory info. Please use newer API

See Also:
getAvailableHeap()

getFreeMemoryInMegabytes

public long getFreeMemoryInMegabytes()
Deprecated. since 3.1 produces misleading memory info. Please use newer API

See Also:
getAvailableHeap()

getUsedMemory

public long getUsedMemory()
Deprecated. since 3.1. Use getUsedHeap()


getUsedMemoryInMegabytes

public long getUsedMemoryInMegabytes()
Deprecated. since 3.1. Use getUsedHeap()



Copyright © 2003-2010 Atlassian. All Rights Reserved.