Skip to content

PageBuilder "Products" slow loading preview and counts (memory exhaustion in the backend) #39564

Open
@ioweb-gr

Description

@ioweb-gr

Preconditions and environment

  • 2.4.7-p2
  • A large catalog with over 4m products of which the majority is configurable products

Steps to reproduce

  1. Navigate to Content -> Pages
  2. Add a new page
  3. Add a new element of type "Products"
  4. Try to work with the conditions
  5. Watch the system crawl to a halt
firefox_ZwX539ahmb.mp4

Internally the system will invoke function \Magento\PageBuilder\Model\Catalog\ProductTotals::getProductTotals which ends up in memory exhaustion

 PHP Fatal error:  Allowed memory size of 805306368 bytes exhausted (tried to allocate 38080004 bytes) in vendor/magento/zend-db/library/Zend/Db/Adapter/Abstract.php on line 875

I've tried increasing up to 12GB and the error is the same.

Expected result

The counts are calculated properly and the system doesn't crash

Actual result

Memory is exhausted

Additional information

After creating an around plugin on the mentioned function this is how fast it loads

<?php
/**
 * Copyright (c) 2025. IOWEB TECHNOLOGIES
 */

namespace Ioweb\MagentoPageBuilderBugFix\Plugin;


use Magento\PageBuilder\Model\Catalog\ProductTotals;

class DisableGetProductTotalsDueToSlowness
{
    /**
     * @param ProductTotals $subject
     * @param callable $proceed
     * @param string $conditions
     * @return array
     */
    public function aroundGetProductTotals(ProductTotals $subject, callable $proceed, string $conditions): array
    {
        return [
            'total' => 0,
            'disabled' => 0,
            'notVisible' => 0
        ];
    }
}
firefox_zS2mOz03PM.mp4

Release note

No response

Triage and priority

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.

Metadata

Metadata

Labels

Type

No type

Projects

Status

On Hold

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions