ATLAS Offline Software
Loading...
Searching...
No Matches
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
17namespace Trk {
18
29
31{
32
33public:
37 void refresh(int pid) const;
38
40 float vmSize() const;
41 float vmRss() const;
42
43private:
44 mutable std::atomic<float> m_vsize;
45 mutable std::atomic<float> m_rss;
46};
47
48inline float
50{
51 return m_vsize;
52}
53
54inline float
56{
57 return m_rss;
58}
59
61MsgStream&
62operator<<(MsgStream& sl, const MemoryLogger& oac);
63std::ostream&
64operator<<(std::ostream& sl, const MemoryLogger& oac);
65
66} // end of namespace Trk
67
68#endif
A small helper class looking at /proc/<PID>status.
std::atomic< float > m_rss
real memory size
float vmRss() const
float vmSize() const
vsize/rss returnal
MemoryLogger()
Default constructor.
std::atomic< float > m_vsize
virtual memory size
void refresh(int pid) const
update the memory logger
Ensure that the ATLAS eigen extensions are properly loaded.
MsgStream & operator<<(MsgStream &sl, const AlignModule &alignModule)
overload of << operator for MsgStream for debug output