memory_get_usage() 함수는 생성된 클래스에 메모리를 할당하기 전후에 고정될 수 있습니다.
class MyBigClass {
var $allocatedSize;
var $allMyOtherStuff;
}
function AllocateMyBigClass() {
$before = memory_get_usage();
$ret = new MyBigClass;
$after = memory_get_usage();
$ret->allocatedSize = ($after - $before);
return $ret;
} 출력은 환경 설정에 대한 개체의 메모리가 됩니다.