ATLAS Offline Software
Loading...
Searching...
No Matches
MemoryMonitoringTool.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
6// MemoryMonitoringTool.h, (c) ATLAS Detector software
8
9#ifndef ISF_TOOLS_MEMORYMONITORINGTOOL_H
10#define ISF_TOOLS_MEMORYMONITORINGTOOL_H 1
11
12// Gaudi & Athena basics
14
15// ISF includes
17
18
19// stl includes
20#include <utility>
21#include <vector>
22
23namespace ISF {
24
26 typedef std::pair <const char* , int> InfoUsagePair;
27 typedef std::vector <InfoUsagePair*> InfoUsagePairVector;
28
29
37 class MemoryMonitoringTool : public extends<AthAlgTool, IMonitoringTool> {
38
39 public:
41 MemoryMonitoringTool( const std::string& t, const std::string& n, const IInterface* p );
42
45
46 // Athena algtool's Hooks
47 StatusCode initialize();
48 StatusCode finalize();
49
51 virtual double getCurrent() const;
52
54 virtual void dumpCurrent(const char *infoStr,
55 bool considerInSummary);
56
58 virtual void recordCurrent(const char *infoStr);
59
61 virtual void dumpSummary(const char *dumpCallDescr) const;
62
63 private:
65 int computeCurMemoryUsage() const;
66
68 unsigned int m_numCalls;
69 unsigned int m_prevCallMemUsage;
72
75
76 };
77
78}
79
80
81#endif //> !ISF_TOOLS_MEMORYMONITORINGTOOL_H
virtual double getCurrent() const
return current memory usage in kBytes
virtual void recordCurrent(const char *infoStr)
store the current memory monitoring information internally
virtual void dumpSummary(const char *dumpCallDescr) const
dump all internally stored memory monitoring information
MemoryMonitoringTool(const std::string &t, const std::string &n, const IInterface *p)
Constructor with parameters.
StatusCode initialize()
Athena algtool Hooks.
StatusCode finalize()
Athena algtool Hook.
unsigned int m_numCalls
needed to compute per event stats
virtual void dumpCurrent(const char *infoStr, bool considerInSummary)
dump current memory monitoring information
InfoUsagePairVector m_table
storing all (infoStr,memUsage) pairs created in recordCurrent(..) calls
int computeCurMemoryUsage() const
consolidate /proc to determine current memory usage
ISFParticleOrderedQueue.
std::pair< const char *, int > InfoUsagePair
these datatypes used to store (infoStr,memUsage) paired info
std::vector< InfoUsagePair * > InfoUsagePairVector