ATLAS Offline Software
MallocStats.cxx
Go to the documentation of this file.
1 
3 /*
4  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 // MallocStats.cxx
8 // Implementation file for class MallocStats
9 // Author: S.Binet<binet@cern.ch>
11 
12 // PerfMonEvent includes
14 
15 // STL includes
16 #include <sstream>
17 
18 namespace PerfMon {
19 
21 // Public methods:
23 
24 // Constructors
27  m_infos (PerfMon::mallinfo())
28 {}
29 
30 
32 // Protected methods:
34 
37 std::string MallocStats::repr()
38 {
39  std::ostringstream s;
40  s << "MALLOC statistics\n"
41  << "=================================================================\n"
42  << "Space allocated from system not using mmap: "
43  << from_system_nmmap() << " bytes\n"
44  << " number of free chunks : " << free_chunks()
45  << "\n"
46  << " space allocated and in use : " << used()
47  << " bytes\n"
48  << " space allocated but not in use : " << not_used()
49  << " bytes\n"
50  << " top-most, releasable (via malloc_trim) space: " << releasable()
51  << " bytes\n"
52  << " maximum total allocated space (?) : " << max_allocated()
53  << " bytes\n"
54  << " FASTBIN blocks \n"
55  << " number of fastbin blocks: " << fastbin_blocks() << "\n"
56  << " space available in freed fastbin blocks: " << fastbin_free()
57  << " bytes\n"
58  << "Space allocated from system using mmap: " << from_system_mmap()
59  << " bytes\n"
60  << " number of chunks allocated via mmap(): " << mmap_chunks()
61  << "\n"
62  << "Total space allocated from system (mmap and not mmap): "
63  << from_system_total() << " bytes\n"
64  << "=================================================================\n"
65  << std::flush;
66  return s.str();
67 }
68 
69 void
70 MallocStats::dump (std::ostream& out)
71 {
72  out << repr();
73 }
74 
75 
76 } //> end namespace PerfMon
77 
PerfMon::MallocStats::fastbin_free
return_type fastbin_free()
Space available in freed fastbin blocks (bytes)
Definition: MallocStats.h:93
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
PerfMon::MallocStats::max_allocated
return_type max_allocated()
Maximum total allocated space (bytes) (always 0 ?)
Definition: MallocStats.h:79
FullCPAlgorithmsTest_eljob.flush
flush
Definition: FullCPAlgorithmsTest_eljob.py:168
MallocStats.h
PerfMon::MallocStats::releasable
return_type releasable()
Top-most, releasable (via malloc_trim) space (bytes)
Definition: MallocStats.h:72
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
PerfMon::mallinfo
mallinfo_t mallinfo()
Definition: mallinfo.h:29
PerfMon::MallocStats::not_used
return_type not_used()
Number of bytes allocated but not in use.
Definition: MallocStats.h:65
PerfMon::MallocStats::dump
void dump(std::ostream &out=std::cout)
display malloc stats on std::cout
Definition: MallocStats.cxx:70
PerfMon
a simple malloc wrapper that keeps track of the amount of memory allocated on the heap.
Definition: CallGraphAuditor.cxx:24
PerfMon::MallocStats::free_chunks
return_type free_chunks()
Returns number of free chunks.
Definition: MallocStats.h:51
PerfMon::MallocStats::mmap_chunks
return_type mmap_chunks()
Number of chunks allocated via mmap()
Definition: MallocStats.h:107
PerfMon::MallocStats::used
return_type used()
Number of bytes allocated and in use.
Definition: MallocStats.h:58
PerfMon::MallocStats::from_system_mmap
return_type from_system_mmap()
Returns number of bytes allocated from system using mmap.
Definition: MallocStats.h:100
PerfMon::MallocStats::from_system_nmmap
return_type from_system_nmmap()
Returns number of bytes allocated from system not including mmapped regions.
Definition: MallocStats.h:44
PerfMon::MallocStats::from_system_total
return_type from_system_total()
Returns total number of bytes allocated from system including mmapped regions.
Definition: MallocStats.h:116
PerfMon::MallocStats::MallocStats
MallocStats()
c-tor
Definition: MallocStats.cxx:26
PerfMon::MallocStats::fastbin_blocks
return_type fastbin_blocks()
Number of fastbin blocks.
Definition: MallocStats.h:86
PerfMon::MallocStats::repr
std::string repr()
display malloc stats
Definition: MallocStats.cxx:37