ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
MemorySnooper Class Reference

#include <MemorySnooper.h>

Collaboration diagram for MemorySnooper:

Public Member Functions

 MemorySnooper (std::string where)
 
int GetMemorySize () const
 

Private Attributes

int imem
 

Detailed Description

Definition at line 16 of file MemorySnooper.h.

Constructor & Destructor Documentation

◆ MemorySnooper()

MemorySnooper::MemorySnooper ( std::string  where)
inline

Definition at line 19 of file MemorySnooper.h.

20  {
21  int pid=getpid();
22  std::ostringstream is;
23  is<<pid;
24  std::string spid=is.str();
25  std::string filename="mem"+spid+".txt";
26  std::string temp="cat /proc/"+spid+"/status | grep VmSize >"+filename;
27  system(temp.c_str());
28  std::ifstream in(filename.c_str());
29  std::string text,mem,text1;
30  in>>text>>mem>>text1;
31  temp="rm -f "+filename;
32  system(temp.c_str());
33  float memsize=atof(mem.c_str());
34  imem=int(memsize);
35  std::cout << "* Memory snooper called at " << where
36  << " with VMEM: " << imem << "kB" << std::endl;
37  //std::cout<<"*****************************************************"<<std::endl
38  // <<"* *"<<std::endl
39  // <<" Memory snooper called here "<<where<<std::endl
40  // <<" process size at this point (VmMem): "<<imem<<" kBytes"<<std::endl
41  // <<"* *"<<std::endl
42  // <<"*****************************************************"<<std::endl;
43  }

Member Function Documentation

◆ GetMemorySize()

int MemorySnooper::GetMemorySize ( ) const
inline

Definition at line 44 of file MemorySnooper.h.

44 {return imem;}

Member Data Documentation

◆ imem

int MemorySnooper::imem
private

Definition at line 46 of file MemorySnooper.h.


The documentation for this class was generated from the following file:
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
ParticleGun_EoverP_Config.pid
pid
Definition: ParticleGun_EoverP_Config.py:62
python.Utils.unixtools.where
def where(filename, prepath=[])
"which" for python files -------------------------------------------------—
Definition: unixtools.py:53
MemorySnooper::imem
int imem
Definition: MemorySnooper.h:46
CxxUtils::atof
double atof(std::string_view str)
Converts a string into a double / float.
Definition: Control/CxxUtils/Root/StringUtils.cxx:91
CaloCellTimeCorrFiller.filename
filename
Definition: CaloCellTimeCorrFiller.py:24
makeTransCanvas.text
text
Definition: makeTransCanvas.py:11