ATLAS Offline Software
MemoryLogger.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // MemoryLogger.h, (c) ATLAS Detector software
8 
9 #ifndef TRKDETDESCRUTILS_MEMORYLOGGER_H
10 #define TRKDETDESCRUTILS_MEMORYLOGGER_H
11 
12 #include <atomic>
13 #include <iostream>
14 // Gaudi
15 #include "GaudiKernel/MsgStream.h"
16 
17 namespace Trk {
18 
31 {
32 
33 public:
35  MemoryLogger();
37  void refresh(int pid) const;
38 
40  float vmSize() const;
41  float vmRss() const;
42 
43 private:
44  mutable std::atomic<float> m_vsize;
45  mutable std::atomic<float> m_rss;
46 };
47 
48 inline float
50 {
51  return m_vsize;
52 }
53 
54 inline float
56 {
57  return m_rss;
58 }
59 
61 MsgStream&
62 operator<<(MsgStream& sl, const MemoryLogger& oac);
63 std::ostream&
64 operator<<(std::ostream& sl, const MemoryLogger& oac);
65 
66 } // end of namespace Trk
67 
68 #endif
Trk::MemoryLogger::refresh
void refresh(int pid) const
update the memory logger
Definition: MemoryLogger.cxx:19
Trk::MemoryLogger::vmRss
float vmRss() const
Definition: MemoryLogger.h:55
Trk::MemoryLogger::MemoryLogger
MemoryLogger()
Default constructor.
Definition: MemoryLogger.cxx:13
Trk::MemoryLogger
Definition: MemoryLogger.h:31
Trk::MemoryLogger::m_vsize
std::atomic< float > m_vsize
virtual memory size
Definition: MemoryLogger.h:44
Trk::MemoryLogger::m_rss
std::atomic< float > m_rss
real memory size
Definition: MemoryLogger.h:45
ParticleGun_EoverP_Config.pid
pid
Definition: ParticleGun_EoverP_Config.py:62
Trk::MemoryLogger::vmSize
float vmSize() const
vsize/rss returnal
Definition: MemoryLogger.h:49
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
Trk::operator<<
MsgStream & operator<<(MsgStream &sl, const AlignModule &alignModule)
overload of << operator for MsgStream for debug output
Definition: AlignModule.cxx:204