Author Topic

Carlos Revillo

Tuesday 02 June 2009 10:16:11 am

Comment51112

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
...