Skip to content

Class MemoryPeakGlobal

ClassList > MemoryPeakGlobal

Metric reporting the global process memory peak in megabytes.More...

  • #include <bench_global_memory_peak.h>

Inherits the following classes: Metric

Public Functions

Type Name
MemoryPeakGlobal ()
Construct the metric with label "GlobalMemoryPeak(Mo)".
virtual void compute (const Mesh & originalMesh, const Mesh & reconstructedMesh, benchmark::State & state) override const
Compute the metric for a single (original, reconstructed) pair.
double get_memory_peak_mo () const
Read the current process memory peak in megabytes.
~MemoryPeakGlobal () = default

Public Functions inherited from Metric

See Metric

Type Name
Metric (const std::string & name)
Construct a metric with the given short label.
virtual void compute (const Mesh & originalMesh, const Mesh & reconstructedMesh, benchmark::State & state) const = 0
Compute the metric for a single (original, reconstructed) pair.
const std::string & getName () const
Return the metric's short label.
virtual ~Metric () = default

Detailed Description

On Linux the value is read from /proc/self/status (VmHWM). On Windows the peak working-set size is read through the PSAPI. The result is recorded under the counter GlobalMemoryPeak(Mo).

Public Functions Documentation

function MemoryPeakGlobal

Construct the metric with label "GlobalMemoryPeak(Mo)".

inline MemoryPeakGlobal::MemoryPeakGlobal () 


function compute

Compute the metric for a single (original, reconstructed) pair.

virtual void MemoryPeakGlobal::compute (
    const Mesh & originalMesh,
    const Mesh & reconstructedMesh,
    benchmark::State & state
) override const

Implementations should record their values on state.counters.

Parameters:

  • originalMesh Ground-truth mesh.
  • reconstructedMesh Mesh produced by the reconstruction algorithm.
  • state Google Benchmark state receiving the counters.

Implements Metric::compute


function get_memory_peak_mo

Read the current process memory peak in megabytes.

double MemoryPeakGlobal::get_memory_peak_mo () const

Returns:

Memory peak in MiB.


function ~MemoryPeakGlobal

MemoryPeakGlobal::~MemoryPeakGlobal () = default


The documentation for this class was generated from the following file benchmark/metrics/implementations/bench_global_memory_peak.h