| # Gaudi Framework, version v20r2
Generated: 18 Jul 2008

- Main Page
- Namespaces
- Classes
- Files
- Directories
- Related Pages

- Search for |

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# MemoryAuditor Class Reference

`#include <MemoryAuditor.h>`

Inheritance diagram for MemoryAuditor:

[legend]
Collaboration diagram for MemoryAuditor:

[legend]
List of all members.

## Detailed Description

Definition at line 14 of file MemoryAuditor.h.

## 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 StatusCode | sysFinalize ()
| Finalization method invoked by the framework.
## Private Member Functions
bool | printinfo (std::string theString)

## Constructor & Destructor Documentation

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

Definition at line 13 of file MemoryAuditor.cpp.

    00013                                                                             :
    00014   Auditor(name, pSvcLocator)
    00015 {
    00016 }

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

Definition at line 18 of file MemoryAuditor.cpp.

    00018                              {
    00019 }

## Member Function Documentation

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

Deprecated:
  use before

Reimplemented from Auditor.

Definition at line 21 of file MemoryAuditor.cpp.

References INamedInterface::name(), and printinfo().

    00021                                                          {
    00022   std::string theString = "Memory usage before ";
    00023   theString += alg->name() ;
    00024   theString += " Initialization Method";
    00025   printinfo(theString);
    00026 }

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

Deprecated:
  use after

Reimplemented from Auditor.

Definition at line 27 of file MemoryAuditor.cpp.

References INamedInterface::name(), and printinfo().

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

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

Deprecated:
  use before

Reimplemented from Auditor.

Definition at line 33 of file MemoryAuditor.cpp.

References INamedInterface::name(), and printinfo().

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

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

Deprecated:
  use after

Reimplemented from Auditor.

Definition at line 39 of file MemoryAuditor.cpp.

References INamedInterface::name(), and printinfo().

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

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

Deprecated:
  use before

Reimplemented from Auditor.

Definition at line 45 of file MemoryAuditor.cpp.

References INamedInterface::name(), and printinfo().

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

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

Deprecated:
  use after

Reimplemented from Auditor.

Definition at line 51 of file MemoryAuditor.cpp.

References INamedInterface::name(), and printinfo().

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

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

Deprecated:
  use before

Reimplemented from Auditor.

Definition at line 57 of file MemoryAuditor.cpp.

References INamedInterface::name(), and printinfo().

    00057                                                        {
    00058   std::string theString = "Memory usage before ";
    00059   theString += ini->name() ;
    00060   theString += " BeginRun Method";
    00061   printinfo(theString);
    00062 }

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

Deprecated:
  use after

Reimplemented from Auditor.

Definition at line 63 of file MemoryAuditor.cpp.

References INamedInterface::name(), and printinfo().

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

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

Deprecated:
  use before

Reimplemented from Auditor.

Definition at line 69 of file MemoryAuditor.cpp.

References INamedInterface::name(), and printinfo().

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

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

Deprecated:
  use after

Reimplemented from Auditor.

Definition at line 75 of file MemoryAuditor.cpp.

References INamedInterface::name(), and printinfo().

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

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

Deprecated:
  use before

Reimplemented from Auditor.

Definition at line 81 of file MemoryAuditor.cpp.

References INamedInterface::name(), and printinfo().

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

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

Deprecated:
  use after

Reimplemented from Auditor.

Definition at line 87 of file MemoryAuditor.cpp.

References INamedInterface::name(), and printinfo().

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

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 94 of file MemoryAuditor.cpp.

References StatusCode::SUCCESS.

    00095 {
    00096   return StatusCode::SUCCESS;
    00097 }

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

Definition at line 99 of file MemoryAuditor.cpp.

References endreq(), ProcStats::fetch(), MSG::INFO, ProcStats::instance(), Auditor::msgSvc(), Auditor::name(), procInfo::rss, and procInfo::vsize.

Referenced by afterBeginRun(), afterEndRun(), afterExecute(), afterFinalize(), afterInitialize(), afterReinitialize(), beforeBeginRun(), beforeEndRun(), beforeExecute(), beforeFinalize(), beforeInitialize(), and beforeReinitialize().

    00100 {
    00101    ProcStats* p = ProcStats::instance();
    00102    procInfo info;
    00103
    00104    // The fetch method returns true if memory usage has changed...
    00105    if( p->fetch(info) == true) {
    00106      MsgStream log(msgSvc(), name());
    00107      log << MSG::INFO << theString <<
    00108        " virtual size = " << info.vsize << " MB"  <<
    00109        " resident set size = " << info.rss << " MB" << endreq;
    00110      return true;
    00111     }
    00112    else {
    00113       return false;
    00114    }
    00115 }

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

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