#include <MemoryMonitoringTool.h>
the code actually computing the memory usage is kindly stolen from: atlasoff:: Simulation/G4Sim/SimHelpers/SimHelpers/MemorySnooper.h
- Author
- Elmar.Ritsch -at- cern.ch
Definition at line 37 of file MemoryMonitoringTool.h.
◆ MemoryMonitoringTool()
ISF::MemoryMonitoringTool::MemoryMonitoringTool |
( |
const std::string & |
t, |
|
|
const std::string & |
n, |
|
|
const IInterface * |
p |
|
) |
| |
◆ ~MemoryMonitoringTool()
ISF::MemoryMonitoringTool::~MemoryMonitoringTool |
( |
| ) |
|
◆ computeCurMemoryUsage()
int ISF::MemoryMonitoringTool::computeCurMemoryUsage |
( |
| ) |
const |
|
private |
consolidate /proc to determine current memory usage
Definition at line 138 of file MemoryMonitoringTool.cxx.
143 std::ostringstream is;
145 std::string spid=is.str();
146 std::string
filename=
"mem"+spid+
".txt";
147 std::string temp=
"cat /proc/"+spid+
"/status | grep VmSize >"+
filename;
148 system(temp.c_str());
150 std::string
text,mem,text1;
151 in>>
text>>mem>>text1;
153 system(temp.c_str());
154 float memsize=
atof(mem.c_str());
◆ dumpCurrent()
void ISF::MemoryMonitoringTool::dumpCurrent |
( |
const char * |
infoStr, |
|
|
bool |
considerInSummary |
|
) |
| |
|
virtual |
dump current memory monitoring information
Definition at line 66 of file MemoryMonitoringTool.cxx.
76 if (considerInSummary) {
83 <<
" (VmMem,diff-previous) kBytes: "
84 << curMem<<
" "<< curDiff );
◆ dumpSummary()
void ISF::MemoryMonitoringTool::dumpSummary |
( |
const char * |
dumpCallDescr | ) |
const |
|
virtual |
dump all internally stored memory monitoring information
Definition at line 108 of file MemoryMonitoringTool.cxx.
110 ATH_MSG_INFO(
"*****************************************************\n"<<
111 "* (VmMem) MEMORY SUMMARY: (kBytes)");
114 InfoUsagePairVector::const_iterator
it =
m_table.begin();
115 InfoUsagePairVector::const_iterator itEnd =
m_table.end();
116 for ( ;
it != itEnd; ++
it) {
117 const char *curInfo = (*it)->first;
118 int curUsage = (*it)->second;
120 ATH_MSG_INFO(
"* Memory Usage " << curInfo <<
"\t\t: " << curUsage);
125 if (!
desc)
desc =
"MemoryMonitor call";
132 ATH_MSG_INFO(
"*****************************************************");
◆ finalize()
StatusCode ISF::MemoryMonitoringTool::finalize |
( |
| ) |
|
◆ getCurrent()
double ISF::MemoryMonitoringTool::getCurrent |
( |
| ) |
const |
|
virtual |
◆ initialize()
StatusCode ISF::MemoryMonitoringTool::initialize |
( |
| ) |
|
◆ recordCurrent()
void ISF::MemoryMonitoringTool::recordCurrent |
( |
const char * |
infoStr | ) |
|
|
virtual |
store the current memory monitoring information internally
Definition at line 93 of file MemoryMonitoringTool.cxx.
97 << curUsage <<
" kBytes");
101 m_table.push_back( curInfoUsage);
◆ m_accumulatedCallMemory
double ISF::MemoryMonitoringTool::m_accumulatedCallMemory |
|
private |
◆ m_accumulatedIncrMemory
double ISF::MemoryMonitoringTool::m_accumulatedIncrMemory |
|
private |
◆ m_numCalls
unsigned int ISF::MemoryMonitoringTool::m_numCalls |
|
private |
◆ m_prevCallMemUsage
unsigned int ISF::MemoryMonitoringTool::m_prevCallMemUsage |
|
private |
◆ m_table
storing all (infoStr,memUsage) pairs created in recordCurrent(..) calls
Definition at line 74 of file MemoryMonitoringTool.h.
The documentation for this class was generated from the following files: