Share » Forums » Developer » Import memory problem

Import memory problem

Import memory problem

Monday 22 June 2009 1:24:56 am - 8 replies

Modified on Monday 22 June 2009 1:33:12 am by Olivier Versanne

Author Message

Jean-Luc Nguyen

Monday 22 June 2009 2:20:59 am

Hello,

After each new created objet, try to clear cache:

eZContentObject::clearCache( $newObjectCreatedID );

Where $newObjectCreatedID is the contentobject_id of you new created object.

http://www.acidre.com

Olivier Versanne

Monday 22 June 2009 5:46:43 am

Thanks, that works better! But, it doesn't work for Attribute storage and Assignement storage. I try to find same functions in these classes without success. Do you have any idea?

Marc Sallaberremborde

Monday 22 June 2009 12:11:03 pm

Hello,

Actually, the right method is :

eZContentCacheManager::clearContentObject( $objectID );

More details here : http://pubsvn.ez.no/doxygen/4.0/html/classeZContentCacheManager.html#381a14270e658e789757c8568b6d3b70

Olivier Versanne

Tuesday 23 June 2009 3:30:06 am

Hello,

I'm using these three functions and they're working quite well for some objects.

eZContentCacheManager::clearContentCache($object->attribute('id'));
eZContentObject::clearCache();
eZContentCacheManager::clearAllContentCache();

But, for the attribute storage of an object:

$dataMap = $object->dataMap();
[...] 
$dataMap[$key]->setAttribute( $dataType, $content );
$dataMap[$key]->store(); // here

And for the publication of an object:

eZOperationHandler::execute( 'content', 'publish', array( 'object_id' => $object->attribute( 'id' ), 'version' => $object->attribute( 'current_version' ) ) );

the three previous functions don't work (memory is still used).

What should I do to free this memory?

Thanks a lot!

Jean-Luc Nguyen

Tuesday 23 June 2009 3:36:52 am

unset( $dataMap );

?

http://www.acidre.com

Heath

Tuesday 23 June 2009 3:50:31 am

Hey you guys .. you really have to search and read the forums to learn these answers have already been shared a hundred times before, the best answer that stops all performance problems is making a master -> worker script using two scripts, one doing the work and one doing the iterating.

<i>http://ez.no/developer/forum/developer/how_to_build_an_update_cli_script_without_memory_problem

more unset global cache ideasin this one,
http://ez.no/developer/forum/developer/memory_leak_on_content_publish</i>

Cheers,
Heath

Brookins Consulting | http://brookinsconsulting.com/
Certified | http://auth.ez.no/certification/verify/380350
Solutions | http://projects.ez.no/users/community/brookins_consulting
eZpedia community documentation project | http://ezpedia.org

Olivier Versanne

Tuesday 23 June 2009 6:30:18 am

@Jean-Luc Nguyen: I'm already doing this unset.

@Marc Sallaberremborde: Your two links are interesting and I update my source code to add propositions like : unset ($GLOBALS['....']). without success.

This problem is existing for two years? There is no other trick that making two scripts?

Francisca Hernández

Tuesday 23 June 2009 2:34:05 pm

hi

we use xmlimport extension (in 4.1) to import objects to ezpublish (first we convert from excel or csv to xml with pentaho) and them we import, the system support 150 objects in each action more or less.

if you want to use your script i recommend to create ezcontentobjecttreenodelite.php as we did for other functionalities.

good luck, fran

Iguana IT, SL - http://www.iguanait.com

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu