Forums / Developer / Publish objects and memory problem

Publish objects and memory problem

Author Message

Fabien Mas

Monday 26 November 2007 2:36:51 am

Hi,
I import an CSV file (from the extension importXMLData) into my tree
But I have this error :

<i>Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 20468 bytes) in /home/web/ezpublishv3/www/lib/ezi18n/classes/ezchartransform.php on line 296
</i>

So I trace my code with memory_get_usage() and I have that function who takes a lot of memory (which is in a foreach)

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

How can I do to reduce the use of memory ?
thx for your help,
Fabien

Fabien Mas

Monday 26 November 2007 7:57:45 am

found this
<i> http://ez.no/community/forum/developer/memory_leak_on_content_publish</i>
It explains some things

So I have rewritten my import function with sessions

But

1) When I build a newsletter with a lot of articles, I have the same problem with memory ..

2) On my local website I have only 64 mb of memory and I have no problem with my import, and on my inline website I have 128 mo of memory and there some problems. The code is the same, what can explain this difference ?

thx, fabien

Xavier Dutoit

Wednesday 28 November 2007 1:16:33 am

What's the differences between your dev and prod machines ?

http://www.sydesy.com

Fabien Mas

Wednesday 28 November 2007 6:10:01 am

Hi Xavier,

thx for your help

Differences between my servers, hard to say
I only know that the prod one has 128 Mo of memory where the dev one has only 64 Mo
I will check this with the administrator

I have downloaded all the files and the database from my prod server to my dev server and I don't have any problem ...

eZ debug

Timing: Jan 20 2025 23:44:03
Script start
Timing: Jan 20 2025 23:44:03
Module start 'content'
Timing: Jan 20 2025 23:44:03
Module end 'content'
Timing: Jan 20 2025 23:44:04
Script end

Main resources:

Total runtime0.1565 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0061 589.3516180.8281
Module start 'content' 0.00610.0055 770.179794.0078
Module end 'content' 0.01160.1447 864.1875523.2969
Script end 0.1564  1,387.4844 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00352.2639200.0002
Check MTime0.00150.9307200.0001
Mysql Total
Database connection0.00070.455610.0007
Mysqli_queries0.109670.07981410.0008
Looping result0.00171.09321390.0000
Template Total0.144492.310.1444
Template load0.00100.611110.0010
Template processing0.143491.645210.1434
Override
Cache load0.00070.447410.0007
Sytem overhead
Fetch class attribute can translate value0.00080.487210.0008
XML
Image XML parsing0.00020.158510.0002
General
dbfile0.00472.9977200.0002
String conversion0.00000.004630.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0002 secs