メモリー・マネージャーの使用方法

PHP V5.2 の新機能、第 1 回: 新しいメモリー・マネージャーの使用方法

[php]

// This is only an example, the numbers below will
// differ depending on your system

echo memory_get_usage() . "\n"; // 36640
$a = str_repeat("Hello", 4242);
echo memory_get_usage() . "\n"; // 57960
unset($a);
echo memory_get_usage() . "\n"; // 36744

?>
[/php]

とりあえずメモ。気になっている箇所でメモリ使用量をチェックすることができます。昨日のsyslog出力と組み合わせたりすると便利かもしれません。

関連する記事:

Powered by

Leave a Comment


NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">