LowMemoryEvent
extends ServerEvent
in package
Called when the server is in a low-memory state as defined by the properties Plugins should free caches or other non-essential data.
Table of Contents
- MAX_EVENT_CALL_DEPTH = 50
- $eventName : string|null
- $eventCallDepth : int
- $global : bool
- $memory : int
- $memoryLimit : int
- $triggerCount : int
- __construct() : mixed
- call() : void
- Calls event handlers registered for this event.
- getEventName() : string
- getMemory() : int
- Returns the memory usage at the time of the event call (in bytes)
- getMemoryFreed() : int
- Amount of memory already freed
- getMemoryLimit() : int
- Returns the memory limit defined (in bytes)
- getTriggerCount() : int
- Returns the times this event has been called in the current low-memory state
- isGlobal() : bool
Constants
MAX_EVENT_CALL_DEPTH
private
mixed
MAX_EVENT_CALL_DEPTH
= 50
Properties
$eventName
protected
string|null
$eventName
= null
$eventCallDepth
private
static int
$eventCallDepth
= 1
$global
private
bool
$global
$memory
private
int
$memory
$memoryLimit
private
int
$memoryLimit
$triggerCount
private
int
$triggerCount
Methods
__construct()
public
__construct(int $memory, int $memoryLimit[, bool $isGlobal = false ][, int $triggerCount = 0 ]) : mixed
Parameters
- $memory : int
- $memoryLimit : int
- $isGlobal : bool = false
- $triggerCount : int = 0
Return values
mixed —call()
Calls event handlers registered for this event.
public
call() : void
Tags
Return values
void —getEventName()
public
final getEventName() : string
Return values
string —getMemory()
Returns the memory usage at the time of the event call (in bytes)
public
getMemory() : int
Return values
int —getMemoryFreed()
Amount of memory already freed
public
getMemoryFreed() : int
Return values
int —getMemoryLimit()
Returns the memory limit defined (in bytes)
public
getMemoryLimit() : int
Return values
int —getTriggerCount()
Returns the times this event has been called in the current low-memory state
public
getTriggerCount() : int
Return values
int —isGlobal()
public
isGlobal() : bool