ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Allowed Memory Size on Channel Entries + Reversed entries + Channel Images

April 30, 2012 8:10am

Subscribe [3]
  • #1 / Apr 30, 2012 8:10am

    Ruslan Ka

    63 posts

    Channel images causing this when trying to render the page

    Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 1966080 bytes) in /home/milkandh/public_html/mobilestore/system/expressionengine/libraries/Functions.php(656) : eval()‘d code on line 2255


    My template

    {exp:channel:entries channel="brands" disable="pagination" dynamic="no" entry_id="{segment_3}" limit="1"}
    {reverse_related_entries orderby="title"}
    and channel images tag

    If channel images commented out than everything runs but slow if channel images are on than it brings the message above

    My php limits are quite good
    128 MB
    max uploaded file 64 MB
    execution time 30 sec

    My EE
    2.3.1

    any suggestions ?

     

  • #2 / Apr 30, 2012 5:04pm

    Dan Decker

    7338 posts

    Hi Ruslan Ka,

    Sorry for your trouble with this!

    The error above points to some errant PHP code in the template. It would be real handy to get a look at the overall template.

    Also, since the template slows down with channel images involved, have you contacted Dev Demon for support as well?

    Cheers,

  • #3 / May 01, 2012 4:16pm

    Ruslan Ka

    63 posts

    Hello Dan,

    I did chat to Devdemon guys and the respond I have got from them is that reverse_related_entries is quite heavy tag by itself.

    see my code below plz.

    {embed='onlineadmin/doc_top'}
    
    <body>
    {embed="onlineadmin/menu"}
      {embed="onlineadmin/column_left"}
    
    <div>
    {exp:channel:entries channel="brands" disable="pagination" dynamic="no" entry_id="{segment_3}" limit="1"}
    <h2>{title}</h2>
    
    <p> {reverse_related_entries orderby="title"}<br />
     <div><br />
      <div>{count}</div></p>
    
    <p>  <div><br />
       <a href="http://{path=onlineadmin/edit_product}/{entry_id}">EDIT</a></p>
    
    <p>   DELETE</p>
    
    <p>  </div></p>
    
    <p>  <div><br />
      </p><h3>  {title}</h3><p>  <br />
      Product Id:{entry_id}</p>
    
    <p><br />
        <div><br />
         PICTURES</p>
    
    <p>     to view and edit pics click on EDIT<br />
         {!--<br />
         {exp:channel_images:images entry_id="{entry_id}"} <br />
          {image:url:small}<br />
         {/exp:channel_images:images}<br />
         --}<br />
        </div><br />
      </p>
    
    <p>  <br />
       <div><br />
       <br />
    PRODUCT RECIPIES<br />
      <br />
       {exp:playa:children field="product_recipes"}<br />
        {embed='onlineadmin/related_recipes' product_id="{entry_id}" brand_id="{segment_3}" category_id="0"}<br />
       {/exp:playa:children}<br />
       </div><br />
      <br />
      <br />
    </div><br />
      </div><br />
     {/reverse_related_entries}</p>
    
    <p>{/exp:channel:entries}<br />
      </div></p>
    
    <p>  {embed="onlineadmin/column_right"}<br />
    </body><br />
    </html>

  • #4 / May 02, 2012 3:51pm

    Dan Decker

    7338 posts

    Hi Russian Ka,

    Indeed, reverse_related is a heavy tag. Adding complex field types like Channel Images and Playa on top of that is causing PHP to run out of memory I suspect.

    Do you have any idea how many Playa relationships or reverse-related entries this is trying to call in? Have you tried adding a limit to the reverse related tag to see if just 1 call will execute?

    Also, have you turned on template debugging to see the query being generated?

    Cheers,

  • #5 / Oct 08, 2012 1:51pm

    EWDC

    58 posts

    Hi Dan,
    Thanks for this, fixed an issue I was facing as well by reducing the limit.
    Is there anyway that we can boost the PHP memory limit?

    Edd

  • #6 / Oct 09, 2012 4:25pm

    Shane Eckert

    7174 posts

    Hey EWDC,

    You can!

    Check out your current settings and adjust as needed. These are in a file called php.ini.

    memory_limit
    This sets the maximum amount of memory in bytes that a script is allowed to allocate.
    Default size 5.3 in is “8M”

    post_max_size (must be greater than upload_max_filesize)
    Sets max size of post data allowed. This setting also affects file upload.
    Default size in 5.3 is “128M”

    upload_max_filesize
    The maximum size of an uploaded file.

    max_execution_time
    This sets the maximum time in seconds a script is allowed to run before it is terminated by the parser.
    Default setting in 5.3 is “30”

    I hope this helps!

    Cheers,

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases