Gaudi Framework, version v23r0

Home   Generated: Mon Jan 30 2012
Public Member Functions | Protected Member Functions | Static Protected Member Functions

MemoryAuditor Class Reference

Monitors the memory use of each algorithm. More...

#include <MemoryAuditor.h>

Inheritance diagram for MemoryAuditor:
Inheritance graph
[legend]
Collaboration diagram for MemoryAuditor:
Collaboration graph
[legend]

List of all members.

Public Member Functions

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

Protected Member Functions

virtual void i_before (CustomEventTypeRef evt, const std::string &caller)
 Default (catch-all) "before" Auditor hook.
virtual void i_after (CustomEventTypeRef evt, const std::string &caller, const StatusCode &sc)
 Default (catch-all) "after" Auditor hook.
virtual void i_printinfo (const std::string &msg, CustomEventTypeRef evt, const std::string &caller)
 Report the memory usage.

Static Protected Member Functions

static bool getProcInfo (procInfo &info)
 Get the process informations.

Detailed Description

Monitors the memory use of each algorithm.

Author:
M. Shapiro, LBNL
Marco Clemencic

Definition at line 11 of file MemoryAuditor.h.


Constructor & Destructor Documentation

MemoryAuditor::MemoryAuditor ( const std::string name,
ISvcLocator pSvcLocator 
)

Definition at line 16 of file MemoryAuditor.cpp.

: CommonAuditor(name, pSvcLocator) {
}

Member Function Documentation

static bool MemoryAuditor::getProcInfo ( procInfo info ) [inline, static, protected]

Get the process informations.

Returns true if it was possible to retrieve the informations.

Definition at line 27 of file MemoryAuditor.h.

                                                 {
    return ProcStats::instance()->fetch(info);
  }
void MemoryAuditor::i_after ( CustomEventTypeRef  evt,
const std::string caller,
const StatusCode sc 
) [protected, virtual]

Default (catch-all) "after" Auditor hook.

Implements CommonAuditor.

Definition at line 24 of file MemoryAuditor.cpp.

                                                                                             {
  i_printinfo("Memory usage has changed after", evt, caller);
}
void MemoryAuditor::i_before ( CustomEventTypeRef  evt,
const std::string caller 
) [protected, virtual]

Default (catch-all) "before" Auditor hook.

Implements CommonAuditor.

Reimplemented in MemStatAuditor.

Definition at line 20 of file MemoryAuditor.cpp.

                                                                            {
  i_printinfo("Memory usage before", evt, caller);
}
void MemoryAuditor::i_printinfo ( const std::string msg,
CustomEventTypeRef  evt,
const std::string caller 
) [protected, virtual]

Report the memory usage.

Reimplemented in MemStatAuditor.

Definition at line 28 of file MemoryAuditor.cpp.

{
   procInfo info;
   // The fetch method returns true if memory usage has changed...
   if(getProcInfo(info)) {
     MsgStream log(msgSvc(), name());
     log << MSG::INFO << msg << " " << caller << " " << evt <<
       " virtual size = " << info.vsize << " MB"  <<
       " resident set size = " << info.rss << " MB" << endmsg;
   }
}

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines

Generated at Mon Jan 30 2012 13:53:18 for Gaudi Framework, version v23r0 by Doxygen version 1.7.2 written by Dimitri van Heesch, © 1997-2004