Inherited by AbstractHeapAnalyzer
[virtual], and ObjectCountHeapAnalyzer
List of all members.
There is at most one HeapAnalyzer registered with the system for the lifetime of the process. The HeapAnalyzer impelmentation may be specified via the "tangosol.coherence.heap.analyzer" system property. The property can be set to one of the following values:
In the case where a custom class is specified, it must implement this interface. The custom analyzer will be initialized as soon as the class is registered with the SystemClassLoader. As static initalization order cannot be guarenteed, this custom analyzer will not be notified of managed objects created earlier in the static initialization order.
The active analyzer may be obtained from the System::getHeapAnalyzer() method.
The HeapAnalyzer and Snapshot interfaces are intentionally narrow. Implementations are expected to provide usefull information via the toStream method, as well as by possibly augmenting the interfaces. The minimal interface is sufficient for detecting memory leaks.
HeapAnalyzer::Snapshot::View vSnap = hAnalyzer->capture(); ... ... std::cout << "Heap changed by: " << hAnalyzer->delta(vSnap) << std::endl;
|HeapAnalyzer Handle definition. |
|HeapAnalyzer View definition. |
|HeapAnalyzer Holder definition. |
Public Member Functions
|virtual Snapshot::View||capture () const =0|
|Capture a Snapshot of the current state of the heap. |
|virtual Snapshot::View||delta (Snapshot::View vThat) const =0|
|Compute the delta between the supplied Snapshot and the current heap state. |
|virtual int64_t||getObjectCount () const =0|
|Return the number of registered objects. |
Static Public Member Functions
|static void||ensureHeap (Snapshot::View vSnap, int64_t cDelta=0)|
|Ensure that the delta between the current heap and the supplied snapshot is as expected. |
Protected Member Functions
|virtual void||registerObject (const Object &o)=0|
|Register a newly created Object with the system. |
|virtual void||unregisterObject (const Object &o)=0|
|Unregister an Object with the system. |
|Snapshot provides a abstract mechanism for comparing successive heap analysis points. More...|
|virtual Snapshot::View capture||(||)|| const
|virtual int64_t getObjectCount||(||)|| const
|virtual void registerObject||(||const Object &||o||)||
|virtual void unregisterObject||(||const Object &||o||)||
Unregister an Object with the system.
|o||the Object to unregister|
|static void ensureHeap||(||Snapshot::View||vSnap,|
|int64_t|| cDelta = |
Ensure that the delta between the current heap and the supplied snapshot is as expected.
This method can be used to perform quick memory leak assertions.
HeapAnalyzer::Snapshot::View vSnapStart = System::getHeapAnalyzer()->capture(); ... ... HeapAnalyzer::ensureHeap(vSnapStart);
|vSnap||the snapshot to ensure|
|cDelta||the allowable change in the heap's object count|