| # Gaudi Framework, version v21r9 |

Home |  | Generated: 3 May 2010

# MemoryAuditor Class Reference

`#include <MemoryAuditor.h>`

Inheritance diagram for MemoryAuditor:

[legend]
Collaboration diagram for MemoryAuditor:

[legend]

List of all members.

## Public Member Functions
| MemoryAuditor (const std::string &name, ISvcLocator *pSvcLocator)
virtual | ~MemoryAuditor ()
virtual void | beforeInitialize (INamedInterface *alg)
virtual void | afterInitialize (INamedInterface *alg)
virtual void | beforeReinitialize (INamedInterface *alg)
virtual void | afterReinitialize (INamedInterface *alg)
virtual void | beforeExecute (INamedInterface *alg)
virtual void | afterExecute (INamedInterface *alg, const StatusCode &)
virtual void | beforeBeginRun (INamedInterface *alg)
virtual void | afterBeginRun (INamedInterface *alg)
virtual void | beforeEndRun (INamedInterface *alg)
virtual void | afterEndRun (INamedInterface *alg)
virtual void | beforeFinalize (INamedInterface *alg)
virtual void | afterFinalize (INamedInterface *alg)
virtual void | before (CustomEventTypeRef evt, const std::string &caller)
virtual void | after (CustomEventTypeRef evt, const std::string &caller, const StatusCode &)
virtual StatusCode | sysFinalize ()
| Finalization method invoked by the framework.
## Private Member Functions
bool | printinfo (std::string theString)
## Private Attributes
StringArrayProperty | m_types

## Detailed Description

Definition at line 12 of file MemoryAuditor.h.

## Constructor & Destructor Documentation

MemoryAuditor::MemoryAuditor | ( | const std::string & | name,
|  | ISvcLocator * | pSvcLocator |
| ) |  |  |

Definition at line 17 of file MemoryAuditor.cpp.

    00017                                                                             :
    00018   Auditor(name, pSvcLocator)
    00019 {
    00020   declareProperty("CustomEventTypes",m_types);
    00021
    00022 }

MemoryAuditor::~MemoryAuditor | ( |  | ) | `[virtual]`

Definition at line 24 of file MemoryAuditor.cpp.

    00024                              {
    00025 }

## Member Function Documentation

void MemoryAuditor::beforeInitialize | ( | INamedInterface * | alg | ) | `[virtual]`

Reimplemented from Auditor.

Definition at line 27 of file MemoryAuditor.cpp.

    00027                                                          {
    00028   std::string theString = "Memory usage before ";
    00029   theString += alg->name() ;
    00030   theString += " Initialization Method";
    00031   printinfo(theString);
    00032 }

void MemoryAuditor::afterInitialize | ( | INamedInterface * | alg | ) | `[virtual]`

Reimplemented from Auditor.

Definition at line 33 of file MemoryAuditor.cpp.

    00033                                                         {
    00034   std::string theString = "Memory usage has changed after ";
    00035   theString += alg->name() ;
    00036   theString += " Initialization Method";
    00037   printinfo(theString);
    00038 }

void MemoryAuditor::beforeReinitialize | ( | INamedInterface * | alg | ) | `[virtual]`

Reimplemented from Auditor.

Definition at line 39 of file MemoryAuditor.cpp.

    00039                                                            {
    00040   std::string theString = "Memory usage before ";
    00041   theString += alg->name() ;
    00042   theString += " Reinitialization Method";
    00043   printinfo(theString);
    00044 }

void MemoryAuditor::afterReinitialize | ( | INamedInterface * | alg | ) | `[virtual]`

Reimplemented from Auditor.

Definition at line 45 of file MemoryAuditor.cpp.

    00045                                                           {
    00046   std::string theString = "Memory usage has changed after ";
    00047   theString += alg->name() ;
    00048   theString += " Reinitialization Method";
    00049   printinfo(theString);
    00050 }

void MemoryAuditor::beforeExecute | ( | INamedInterface * | alg | ) | `[virtual]`

Reimplemented from Auditor.

Definition at line 51 of file MemoryAuditor.cpp.

    00051                                                       {
    00052   std::string theString = "Memory usage has changed before ";
    00053   theString += alg->name() ;
    00054   theString += " Execute Method";
    00055   printinfo(theString);
    00056 }

void MemoryAuditor::afterExecute | ( | INamedInterface * | alg,
|  | const StatusCode & |  |
| ) |  |  | `[virtual]`

Reimplemented from Auditor.

Definition at line 57 of file MemoryAuditor.cpp.

    00057                                                                           {
    00058   std::string theString = "Memory usage has changed after ";
    00059   theString += alg->name() ;
    00060   theString += " Execute Method";
    00061   printinfo(theString);
    00062 }

void MemoryAuditor::beforeBeginRun | ( | INamedInterface * | alg | ) | `[virtual]`

Reimplemented from Auditor.

Definition at line 63 of file MemoryAuditor.cpp.

    00063                                                        {
    00064   std::string theString = "Memory usage before ";
    00065   theString += ini->name() ;
    00066   theString += " BeginRun Method";
    00067   printinfo(theString);
    00068 }

void MemoryAuditor::afterBeginRun | ( | INamedInterface * | alg | ) | `[virtual]`

Reimplemented from Auditor.

Definition at line 69 of file MemoryAuditor.cpp.

    00069                                                       {
    00070   std::string theString = "Memory usage has changed after ";
    00071   theString += ini->name() ;
    00072   theString += " BeginRun Method";
    00073   printinfo(theString);
    00074 }

void MemoryAuditor::beforeEndRun | ( | INamedInterface * | alg | ) | `[virtual]`

Reimplemented from Auditor.

Definition at line 75 of file MemoryAuditor.cpp.

    00075                                                      {
    00076   std::string theString = "Memory usage before ";
    00077   theString += ini->name() ;
    00078   theString += " EndRun Method";
    00079   printinfo(theString);
    00080 }

void MemoryAuditor::afterEndRun | ( | INamedInterface * | alg | ) | `[virtual]`

Reimplemented from Auditor.

Definition at line 81 of file MemoryAuditor.cpp.

    00081                                                     {
    00082   std::string theString = "Memory usage has changed after ";
    00083   theString += ini->name() ;
    00084   theString += " EndRun Method";
    00085   printinfo(theString);
    00086 }

void MemoryAuditor::beforeFinalize | ( | INamedInterface * | alg | ) | `[virtual]`

Reimplemented from Auditor.

Definition at line 87 of file MemoryAuditor.cpp.

    00087                                                         {
    00088   std::string theString = "Memory usage has changed before ";
    00089   theString += alg->name() ;
    00090   theString += " Finalize Method";
    00091   printinfo(theString);
    00092 }

void MemoryAuditor::afterFinalize | ( | INamedInterface * | alg | ) | `[virtual]`

Reimplemented from Auditor.

Definition at line 93 of file MemoryAuditor.cpp.

    00093                                                       {
    00094   std::string theString = "Memory usage has changed after ";
    00095   theString += alg->name() ;
    00096   theString += " Finalize Method";
    00097   printinfo(theString);
    00098 }

void MemoryAuditor::before | ( | CustomEventTypeRef | evt,
|  | const std::string & | caller |
| ) |  |  | `[virtual]`

Reimplemented from Auditor.

Definition at line 101 of file MemoryAuditor.cpp.

    00101                                                                      {
    00102   if (m_types.value().size() != 0) {
    00103     if ( (m_types.value())[0] == "none") {
    00104       return;
    00105     }
    00106
    00107     if ( find(m_types.value().begin(), m_types.value().end(), evt) ==
    00108          m_types.value().end() ) {
    00109       return;
    00110     }
    00111   }
    00112
    00113   std::string theString = "Memory usage before ";
    00114   theString += caller + " with auditor trigger " + evt;
    00115   printinfo(theString);
    00116
    00117 }

void MemoryAuditor::after | ( | CustomEventTypeRef | evt,
|  | const std::string & | caller,
|  | const StatusCode & |  |
| ) |  |  | `[virtual]`

Reimplemented from Auditor.

Definition at line 120 of file MemoryAuditor.cpp.

    00120                                                                                        {
    00121
    00122   if (m_types.value().size() != 0) {
    00123     if ( (m_types.value())[0] == "none") {
    00124       return;
    00125     }
    00126
    00127     if ( find(m_types.value().begin(), m_types.value().end(), evt) ==
    00128          m_types.value().end() ) {
    00129       return;
    00130     }
    00131   }
    00132
    00133   std::string theString = "Memory usage has changed after ";
    00134   theString += caller + " with auditor trigger " + evt;
    00135   printinfo(theString);
    00136
    00137 }

StatusCode MemoryAuditor::sysFinalize | ( |  | ) | `[virtual]`

Finalization method invoked by the framework.

This method is responsible for any bookkeeping of initialization required by the framework itself.

RETURN !!!

catch GaudiExeption

(1) perform the printout of message

(2) print the exception itself (NB! - GaudiException is a linked list of all "previous exceptions")

catch std::exception

(1) perform the printout of message

(2) print the exception itself

catch unknown exception

(1) perform the printout

Reimplemented from Auditor.

Definition at line 140 of file MemoryAuditor.cpp.

    00141 {
    00142   return StatusCode::SUCCESS;
    00143 }

bool MemoryAuditor::printinfo | ( | std::string | theString | ) | `[private]`

Definition at line 145 of file MemoryAuditor.cpp.

    00146 {
    00147    ProcStats* p = ProcStats::instance();
    00148    procInfo info;
    00149
    00150    // The fetch method returns true if memory usage has changed...
    00151    if( p->fetch(info) == true) {
    00152      MsgStream log(msgSvc(), name());
    00153      log << MSG::INFO << theString <<
    00154        " virtual size = " << info.vsize << " MB"  <<
    00155        " resident set size = " << info.rss << " MB" << endmsg;
    00156      return true;
    00157     }
    00158    else {
    00159       return false;
    00160    }
    00161 }

## Member Data Documentation

StringArrayProperty MemoryAuditor::m_types`[private]`

Definition at line 37 of file MemoryAuditor.h.

The documentation for this class was generated from the following files:

- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v21r9/GaudiAud/src/MemoryAuditor.h
- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v21r9/GaudiAud/src/MemoryAuditor.cpp