HighLAND
Classes | Public Member Functions | List of all members
MemoryUsage Class Reference

#include <MemoryUsage.hxx>

Classes

struct  CmpMemResident
 
struct  CmpMemVirtual
 

Public Member Functions

 MemoryUsage ()
 Construct the memory usage class with logging disabled.
 
void Enable (bool enable=true)
 
void LogMemory ()
 
void Write ()
 Write histograms of the memory usage to the output file.
 

Detailed Description

This class can be used to generate histograms of the memory used by a highland analysis. Logging can be enabled by specifying the "-m" option on the command line. AnalysisBase and SimpleLoopBase will then instantiate, log and write out the memory usage to the output file.

Definition at line 11 of file MemoryUsage.hxx.

Member Function Documentation

§ Enable()

void MemoryUsage::Enable ( bool  enable = true)

Called to enable the memory logging. Enable the logging of memory usage. If this is not called, LogMemory() and Write() have no effects. This can be called with a bool argument to set the enabled flag. If the argument is false, then memory logging is disabled.

Definition at line 14 of file MemoryUsage.cxx.

14  {
15  fEnabled = enable;
16 }

§ LogMemory()

void MemoryUsage::LogMemory ( )

Log the current memory usage. Record the current memory being used by the process. If Enable() has not been called, this function does nothing. In general, the memory usage should be logged once per event, but it can be called any number of times. Logging memory requires saving two float and two longs into a vector.

Definition at line 18 of file MemoryUsage.cxx.

18  {
19  if (!fEnabled) {
20  return;
21  }
22  ProcInfo_t info;
23  gSystem->GetProcInfo(&info);
24  fEventMemory.push_back(info);
25 }

The documentation for this class was generated from the following files: