#include <coherence/lang/ClassBasedHeapAnalyzer.hpp>
Inherits AbstractHeapAnalyzer.
The memory consumption of this heap analyzer is relative to the number of classes used within the process. The CPU consumption is also very low, each registration consists of roughly four compare-and-set operations. It is well suited for development as well as many production environments.
Public Types | |||||||
typedef spec::Handle | Handle | ||||||
ClassBasedHeapAnalyzer Handle definition. | |||||||
typedef spec::View | View | ||||||
ClassBasedHeapAnalyzer View definition. | |||||||
typedef spec::Holder | Holder | ||||||
ClassBasedHeapAnalyzer Holder definition. | |||||||
Public Member Functions | |||||||
virtual HeapAnalyzer::Snapshot::View | capture () const | ||||||
Capture a Snapshot of the current state of the heap. Note, when performing captures in a loop, and assigning the captured snapshot to a handle referencing a snapshot, it is advisable to NULL out the handle first, so as to avoid the new snapshot including the "cost" of snapshot it is about to replace.
| |||||||
virtual HeapAnalyzer::Snapshot::View | delta (HeapAnalyzer::Snapshot::View vSnap) const | ||||||
Compute the delta between the supplied Snapshot and the current heap state.
| |||||||
virtual int64_t | getObjectCount () const | ||||||
Return the number of registered objects.
| |||||||
Protected Member Functions | |||||||
ClassBasedHeapAnalyzer (bool fShowAllocations=false) | |||||||
Create a new ClassBasedHeapAnalyzer. | |||||||
virtual void | safeRegisterObject (const Object &o) | ||||||
Registers an object with the heap analyzer.
| |||||||
virtual void | safeUnregisterObject (const Object &o) | ||||||
Unregisters an object with the heap analyzer.
| |||||||
virtual void | registerObject (const Object &o) | ||||||
Register a newly created Object with the system. This method is called automatically by coherence::lang::Object once the Object has finished construction.
| |||||||
virtual void | unregisterObject (const Object &o) | ||||||
Unregister an Object with the system. This method is called automatically by coherence::lang::Object just prior to the deletion of the Object. No new handles or views may be created to the object.
| |||||||
Protected Attributes | |||||||
bool | m_fShowAllocations | ||||||
True if allocations should be printed as part of analysis. | |||||||
Classes | |||||||
class | ClassStats | ||||||
Statistics relating to a class. More... | |||||||
class | Snapshot | ||||||
Snapshot containing the object count. More... |
ClassBasedHeapAnalyzer | ( | bool | fShowAllocations = false |
) | [protected] |
Create a new ClassBasedHeapAnalyzer.
fShowAllocations | true if allocations should also be shown |