Forums / Developer / How to build an update CLI script without memory problem ? / Comment51112
Carlos Revillo
Tuesday 02 June 2009 10:16:11 am
still doesn't work for me.
I modified the script above to go like this
$userId = eZUser::currentUser()->id(); $nodes = eZContentObjectTreeNode::subTreeByNodeId( array("Limit" => 100) , 2 ); for ( $i = 0; $i < count( $nodes ); $i++ ) { $data = $nodes[$i]->dataMap(); echo memory_get_usage() . "<br />"; unset( $data ); unset( $GLOBALS['eZContentObjectContentObjectCache'] ); unset( $GLOBALS['eZContentObjectDataMapCache'] ); unset( $GLOBALS['eZContentObjectVersionCache'] ); unset( $GLOBALS['eZContentClassAttributeCache'] ); eZContentObject::clearCache(); unset( $GLOBALS["eZUserObject_".$userId] ); }
and the output is like
4143568 4144848 4148140 4171200 4202448 4261052 4307916 4325192 4391336 4434664 4451236 ...