Skip to content

Memory Leak PHP 8.2.0. #5

@ataucher

Description

@ataucher

Pointing out a memory leak i'm experiencing with EE 7.5.17, PHP 8.2.0 and using Cloudflare R2:
PHP Fatal error: Allowed memory size of 536870912 bytes exhausted /system/user/addons/cloud_files/vendor-build/guzzlehttp/psr7/src/Utils.php on line 340

I have a template code that's looping through a few entries:

    <section class="portrait-card-grid" aria-label="">
      {exp:channel:entries channel="projects" dynamic="no" limit="8"}
       <article class="portrait-card" style="--portrait-img:url('{project_card_image}')">
        <span class="portrait-media" aria-hidden="true"></span>
        <span class="portrait-overlay" aria-hidden="true"></span>
        <div class="portrait-content">
          <div class="portrait-text">
            <h4>{project_location}</h4>
            <h3 class="portrait-title">{title}</h3>
            <div class="portrait-body">
              <p>{project_teaser}</p>
              <a class="portrait-link" href="{page_url}">View the Project <i class="ri-arrow-right-up-line"></i></a>
            </div>
          </div>
        </div>
        <span class="portrait-action" aria-hidden="true"></span>
      </article>
      {/exp:channel:entries}
    </section>

Each entry holds a video file (~15MB), image file (~2MB) and a card image (~500kb). Though those aren't being loaded on the template render, they're for the individual project entries. But it seems that Cloudfiles gathers all remote data for entries within the loop before rendering even if those fields aren't being used in the actual template.

I used this same type of loop and content in an Eleventy site build, my page loads under 1s. After porting it to expressionengine and using cloudfiles for the entry the page load is upward of 12s for TTFB.

My only workaround is to just use Cloudfiles to upload my assets to CF, then use plain text fields to store the file names i need, instead of the actual objects from CF. Curious if there's any way to get plain text from a file field that's using Cloudfiles, or any other type of workaround, and of course, if this could be patched somehow?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions