The Pedigree Project  0.1
Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Attributes | Static Private Attributes | List of all members
MemoryPressureManager Class Reference

#include <MemoryPressureManager.h>

+ Collaboration diagram for MemoryPressureManager:

Public Member Functions

bool compact ()
 
void registerHandler (size_t prio, MemoryPressureHandler *pHandler)
 
void removeHandler (MemoryPressureHandler *pHandler)
 

Static Public Member Functions

static MemoryPressureManagerinstance ()
 
static size_t getHighWatermark ()
 
static size_t getLowWatermark ()
 

Static Public Attributes

static const size_t HighestPriority = 0
 
static const size_t HighPriority = MAX_MEMPRESSURE_PRIORITY / 3
 
static const size_t MediumPriority = MAX_MEMPRESSURE_PRIORITY / 2
 
static const size_t LowPriority = (MAX_MEMPRESSURE_PRIORITY * 2) / 3
 
static const size_t LowestPriority = MAX_MEMPRESSURE_PRIORITY - 1
 

Private Attributes

List< MemoryPressureHandler * > m_Handlers [MAX_MEMPRESSURE_PRIORITY]
 

Static Private Attributes

static MemoryPressureManager m_Instance
 

Detailed Description

MemoryPressureManager: global memory pressure handling.

This class offers a central interface for the various mechanisms available to alleviate memory pressure to register themselves and be called, without requiring the kernel itself to know about them (eg, loadable modules).

Definition at line 58 of file MemoryPressureManager.h.

Member Function Documentation

bool MemoryPressureManager::compact ( )

Attempt to alleviate memory pressure by requesting registered handlers release pages that can be safely released.

Definition at line 30 of file MemoryPressureManager.cc.

References List< T, nodePoolSize >::end(), and NOTICE.

void MemoryPressureManager::registerHandler ( size_t  prio,
MemoryPressureHandler pHandler 
)

Register a new handler.

Definition at line 53 of file MemoryPressureManager.cc.

References List< T, nodePoolSize >::pushBack().

Referenced by MemoryPool::initialise(), and MemoryMapManager::MemoryMapManager().

+ Here is the caller graph for this function:

void MemoryPressureManager::removeHandler ( MemoryPressureHandler pHandler)

Remove a handler.

Definition at line 62 of file MemoryPressureManager.cc.

References List< T, nodePoolSize >::end(), and List< T, nodePoolSize >::erase().

Referenced by MemoryMapManager::MemoryMapManager().

+ Here is the caller graph for this function:


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