ClassBasedHeapAnalyzer Class Reference

#include <coherence/lang/ClassBasedHeapAnalyzer.hpp>

Inherits AbstractHeapAnalyzer.

List of all members.


Detailed Description

ClassBasedHeapAnalyzer provides heap analysis at the class level, that is it tracks the number of live instances of each class.

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 envrionments.

See also:
ObjectCountHeapAnalyzer for a lower overhead analyzer
Author:
mf 2008.04.27

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.

Returns:
a Snapshot of the current state of the heap.

virtual
HeapAnalyzer::Snapshot::View 
delta (HeapAnalyzer::Snapshot::View vSnap) const
 Compute the delta between the supplied Snapshot and the current heap state.

Parameters:
vThat the snapshot to compare against.
Returns:
a snapshot containing the delta

virtual int64_t getObjectCount () const
 Return the number of registered objects.

Returns:
the number of registered objects


Protected Member Functions

 ClassBasedHeapAnalyzer ()
 Create a new ClassBasedHeapAnalyzer.
virtual void safeRegisterObject (const Object &o)
 Registers an object with the heap analyzer.

Parameters:
o the object to register

virtual void safeUnregisterObject (const Object &o)
 Unregisters an object with the heap analyzer.

Parameters:
o the object to unregister

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.

Parameters:
o the newly created Object.

If the calling thread is reentering this method return immediatley otherwise delegates to safeRegisterObject.

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.

Parameters:
o the Object to unregister

If the calling thread is reentering this method return immediatley otherwise delegates to safeUnregisterObject.


Classes

class  ClassStats
 Statistics relating to a class. More...
class  Snapshot
 Snapshot containging the object count. More...

The documentation for this class was generated from the following file: Copyright (c) 2000-2008 Oracle. All rights reserved.