Class MemoryUsage
Utility class for Tracking Memory Usage with an imposed limit on the amount available. Provides methods for objects to wait on more space to become available if the memory limit is reached.
Inheritance
System.Object
MemoryUsage
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Apache.NMS.ActiveMQ.Util
Assembly: Apache.NMS.ActiveMQ.dll
Syntax
public class MemoryUsage
Constructors
| Improve this Doc View SourceMemoryUsage()
Declaration
public MemoryUsage()
MemoryUsage(Int64)
Declaration
public MemoryUsage(long limit)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int64 | limit |
Properties
| Improve this Doc View SourceLimit
Declaration
public long Limit { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Int64 |
Usage
Declaration
public long Usage { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Int64 |
Methods
| Improve this Doc View SourceDecreaseUsage(Int64)
Decrease the level of Usage.
Declaration
public void DecreaseUsage(long value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int64 | value | A System.Int64 |
EnqueueUsage(Int64)
Attempts to increase the amount of Memory Used, if non is available to fill then this method blocks until more is freed.
Declaration
public void EnqueueUsage(long usage)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int64 | usage | A System.Int64 |
IncreaseUsage(Int64)
Increase the level of Usage.
Declaration
public void IncreaseUsage(long value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int64 | value | A System.Int64 |
IsFull()
Checks if the Usage Windows has become full, is so returns true otherwise returns false.
Declaration
public bool IsFull()
Returns
| Type | Description |
|---|---|
| System.Boolean | A System.Boolean |
Stop()
Declaration
public void Stop()
WaitForSpace()
If no space is available then this method blocks until more becomes available.
Declaration
public void WaitForSpace()
WaitForSpace(TimeSpan)
If no space is available then this method blocks until more becomes available or until the specified timeout expires.
Declaration
public void WaitForSpace(TimeSpan timeout)
Parameters
| Type | Name | Description |
|---|---|---|
| System.TimeSpan | timeout | A System.TimeSpan |