Geophysical Inversion and Modelling Library
v1.5.2-5-g042d7f36
|
Memory watch. More...
Public Member Functions | |
double | inUse () |
double | current () |
void | info (const std::string &str="") |
Protected Attributes | |
double | last_ |
Friends | |
class | Singleton< MemWatch > |
Additional Inherited Members | |
![]() | |
static MemWatch * | pInstance () |
static MemWatch & | instance () |
![]() | |
Singleton () | |
Singleton (const Singleton &) | |
Memory watch.
Class that might help debugging memory usage. Informations are taken from /proc system, so only available for linux systems. This is a singleton class to ensure a single instance. To call it use e.g.: MemWatch::instance().info(WHERE);
double GIMLI::MemWatch::current | ( | ) |
void GIMLI::MemWatch::info | ( | const std::string & | str = "" | ) |
Shows the current and the relative (to the last call) memory usage.
References current(), GIMLI::Stopwatch::duration(), and inUse().
double GIMLI::MemWatch::inUse | ( | ) |
Return the current memory usage of the process. Values are in MByte.
References GIMLI::MByte().
Referenced by current(), info(), and GIMLI::memoryInUse().