Mantid
Loading...
Searching...
No Matches
Memory.cpp
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
8#include <boost/python/class.hpp>
9
11using namespace boost::python;
12
14
15 class_<MemoryStats>("MemoryStats", init<>(arg("self"), "Construct MemoryStats object."))
16 .def("update", &MemoryStats::update, arg("self"))
17 .def("totalMem", &MemoryStats::totalMem, arg("self"))
18 .def("availMem", &MemoryStats::availMem, arg("self"))
19 .def("residentMem", &MemoryStats::residentMem, arg("self"))
20 .def("virtualMem", &MemoryStats::virtualMem, arg("self"))
21 .def("reservedMem", &MemoryStats::reservedMem, arg("self"))
22 .def("getFreeRatio", &MemoryStats::getFreeRatio, arg("self"))
23 .def("getCurrentRSS", &MemoryStats::getCurrentRSS, arg("self"))
24 .def("getPeakRSS", &MemoryStats::getPeakRSS, arg("self"));
25}
void export_MemoryStats()
Definition: Memory.cpp:13
This class is responsible for memory statistics.
Definition: Memory.h:28
double getFreeRatio() const
The ratio of available to total system memory as a number between 0-100.
Definition: Memory.cpp:459
std::size_t reservedMem() const
Returns the reserved memory that has not been factored into the available memory calculation.
Definition: Memory.cpp:425
void update()
Update the structure with current information, taking into account what is to be ignored.
Definition: Memory.cpp:343
std::size_t getCurrentRSS() const
Definition: Memory.cpp:528
std::size_t getPeakRSS() const
Definition: Memory.cpp:484
std::size_t totalMem() const
Returns the total memory of the system.
Definition: Memory.cpp:391
std::size_t availMem() const
Returns the available memory of the system in kiB.
Definition: Memory.cpp:398
std::size_t residentMem() const
Returns the memory usage of the current process in kiB.
Definition: Memory.cpp:404
std::size_t virtualMem() const
Returns the virtual memory usage of the current process in kiB.
Definition: Memory.cpp:412