« Back to Product

Documentation

IPS_GetThreadStats

 array IPS_GetThreadStats ()

Returns

An array with the following key => value pairs:

Index Type Description
Count integer Number of script threads currently holding a PHP environment
TotalBytes integer Memory reserved by the PHP memory manager across all threads in bytes

Description

Warning

This function is intended for internal use only and may change or be removed at any time without notice.

The function returns the memory usage of the script threads of the PHP script environment. So that scripts can start quickly, threads keep their PHP environment after the execution. Count is the number of these threads, TotalBytes the sum of the memory the PHP memory manager (Zend Memory Manager) keeps reserved in these threads. Information about the individual threads is returned by IPS_GetScriptThreads.

TotalBytes is the value reported by the PHP memory manager at the end of the last execution in the respective thread. The value is also recorded in the series "ScriptEngine" of IPS_GetStatsHistory.

Example

// Output the memory usage of the script threads
print_r(IPS_GetThreadStats());

/* e.g. returns:
Array
(
    [Count] => 4
    [TotalBytes] => 8388608
)
*/
Any questions?