Reducing memory usage

Author Message

James Packham

Monday 19 April 2004 7:09:30 am

Hi,

I know this is a difficult question to answer outright, so really I'm just looking for some tips. I have a virtual hosting setup running EZP 3.3-2 (I have to use this version until 3.4 comes out stable, because PHP is compiled as CGI). This setup also has a memory limit of 16MB, which isn't quite enough.

One of the areas of my site runs out of memory and some other areas don't load first time. I think this is something that I'm ultimately going to have to fix with an upgrade of EZP to a less 'memory intensive' version of EZP (i.e. 3.4 when it comes out).

In the meantime, can anyone give me some tips on how to reduce memory usage?

The error messages I get are fairly standard stuff:

Exhausted memory in kernel/classes/ezcontentobjectattribute.php
Exhausted memory in kernel/classes/ezpersistentobject.php

Are these errors usually to do with the design of the templates, or the complexity of objects in the database?

Thanks in advance,

James

James Packham

Monday 19 April 2004 8:31:28 am

Ah! No worries, I stumbled accross this PHP function:

ini_set( "memory_limit", "20M");

Which set the php memory limit to 20MB and sets it back to normal once the script has finished running. Should have read the docs really!

~James~

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 19 2025 13:54:28
Script start
Timing: Jan 19 2025 13:54:28
Module start 'layout'
Timing: Jan 19 2025 13:54:28
Module start 'content'
Timing: Jan 19 2025 13:54:29
Module end 'content'
Timing: Jan 19 2025 13:54:29
Script end

Main resources:

Total runtime1.0936 sec
Peak memory usage4,096.0000 KB
Database Queries52

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0046 589.1484152.6250
Module start 'layout' 0.00460.0022 741.773439.4453
Module start 'content' 0.00681.0856 781.2188460.7344
Module end 'content' 1.09250.0011 1,241.95318.1719
Script end 1.0935  1,250.1250 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00290.2647160.0002
Check MTime0.00120.1074160.0001
Mysql Total
Database connection0.00060.059010.0006
Mysqli_queries1.051996.1859520.0202
Looping result0.00040.0328500.0000
Template Total1.067297.620.5336
Template load0.00190.171420.0009
Template processing1.065397.412920.5326
Template load and register function0.00020.014210.0002
states
state_id_array0.00070.068310.0007
state_identifier_array0.00070.064320.0004
Override
Cache load0.00160.1431200.0001
Sytem overhead
Fetch class attribute can translate value0.00040.038610.0004
Fetch class attribute name0.00090.081230.0003
XML
Image XML parsing0.00180.167210.0018
class_abstraction
Instantiating content class attribute0.00000.000840.0000
General
dbfile0.00270.2512160.0002
String conversion0.00000.000740.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
4content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 12
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs