|
gc_statusガベージコレクタに関する情報を取得する 説明
array gc_status()
ガベージコレクタの現在の状態に関する情報を取得します。 パラメータこの関数にはパラメータはありません。 戻り値次の要素を持つ連想配列を返します:
変更履歴
例
例1 gc_status の使い方 上の例の出力は、 たとえば以下のようになります。
array(4) {
["runs"]=>
int(5)
["collected"]=>
int(100002)
["threshold"]=>
int(50001)
["roots"]=>
int(0)
}
上の例の PHP 8.3 での出力は、たとえば以下のようになります。:
array(12) {
["running"]=>
bool(false)
["protected"]=>
bool(false)
["full"]=>
bool(false)
["runs"]=>
int(5)
["collected"]=>
int(100002)
["threshold"]=>
int(50001)
["buffer_size"]=>
int(131072)
["roots"]=>
int(0)
["application_time"]=>
float(0.031182458)
["collector_time"]=>
float(0.020106291)
["destructor_time"]=>
float(0)
["free_time"]=>
float(0.003707167)
}
|