VMRSSLimit Class Reference
[Monitors]

#include <VMRSSLimit.h>

Inheritance diagram for VMRSSLimit:

Inheritance graph
[legend]
Collaboration diagram for VMRSSLimit:

Collaboration graph
[legend]

List of all members.


Detailed Description

Virtual Memory Resident Set Size Limiter.

Kills your application if it uses too much virtual memory, after calling the (optional) callback function

Warning:
Assumes a page size of 4KB.
Todo:
JBurke, can you check these docs, and add an example of what callbackFnc should be?

Definition at line 57 of file VMRSSLimit.h.


Public Member Functions

 VMRSSLimit (double maxRSS_MB, void(*callbackFnc)(double))
void expire ()

Static Public Member Functions

static void runVMRSSLimit (double maxRSS_MB, void(*callbackFnc)(double))
 Start the CPU load and usage monitor with max in MB, optional callback function.
static void stopVMRSSLimit ()
 stops the limiter
static double getRSS ()
 return the latest virtual memory size

Static Public Attributes

static const uint64_t DEFAULT_FREQUENCY = 5*1000*1000
 default limiter frequency

Constructor & Destructor Documentation

VMRSSLimit::VMRSSLimit ( double  maxRSS_MB,
void(*)(double)  callbackFnc 
)

Todo:
should this constructor be private?

Definition at line 63 of file VMRSSLimit.cc.

References ADD_SELECTORS, and maceLog.

Referenced by runVMRSSLimit().


Member Function Documentation

void VMRSSLimit::expire (  )  [virtual]

implemented by each timer subclass with the action to take when the timer fires

Implements TimerHandler.

Definition at line 82 of file VMRSSLimit.cc.

References ABORT, ADD_SELECTORS, maceError, maceLog, and TimerHandler::schedule().


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

Generated on Sat Oct 4 21:30:31 2008 for Mace Library by  doxygen 1.5.5