cancel
Showing results for 
Search instead for 
Did you mean: 

Customer Credit Report showing php memeory error

Customer Credit Report showing php memeory error

Hi,

In magento we have 127538 customers. When I click on Admin Panel->Customer->Customer Credit Report it is showing the following error. In server php memory limit is set to -1. How to solve this error?
Thanks
customer-1.png

7 REPLIES 7

Re: Customer Credit Report showing php memeory error

Hello,

 

It appears that this section has been custom developed in your website’s backend, as this feature is not available in either MOS or Adobe Commerce by default.

 

Please verify whether pagination has been implemented for this section.

 

If this module was purchased from a third-party vendor, we recommend reaching out to the module developer's support team for assistance.

- rxraj

Re: Customer Credit Report showing php memeory error

Hi @padmachhat5f0d ,

When Magento’s “Customer Credit Report” grid tries to load 127538 customer-balance rows all in one go, it’s not at all surprising that PHP ends up chewing through tens or even hundreds of megabytes of Random Access Memory - especially if export‐to‐CSV is triggered, which pulls the entire collection into memory.

If upping PHP’s memory still isn’t enough (or you’d rather not throw hardware at the problem), you can customize the credit-report grid so that it:

Paginates the export rather than loading the full collection at once

Streams rows into CSV in batches, e.g.

$batchSize = 500;
$currentPage = 1;
$collection = $this->collectionFactory->create();
$collection->setPageSize($batchSize);
do {
    $collection->setCurPage($currentPage++);
    foreach ($collection as $item) {
        // write $item to CSV file
    }
    $collection->clear(); // free memory
} while ($currentPage <= $collection->getLastPageNumber());

You could override the export action in your own module to implement chunked exporting instead of the default load-everything approach.

 

Run a cron job or CLI task for large exports

If your users only occasionally need the CSV, consider:

Writing a small shell script or Symfony Console command that generates the credit-report CSV with unlimited memory

Scheduling it via cron so that it runs during off-peak hours and places the file on the server or emails it to the user

That way, the Admin UI never has to bear the full memory burden itself.

 

Problem Solved? Accept as Solution!

 

Thanks,

Ankit

 

 

Ankit Jasani

Re: Customer Credit Report showing php memeory error

Handling large data sets can be tricky is like a memory optimization issue. Kind of like managing resources in age of war free to play, you need to balance capacity and usage carefully to avoid crashes.

Re: Customer Credit Report showing php memeory error

You might need to optimize the query or use pagination to avoid loading all 127k customers at once. I had a similar issue and found tips through community groups like Reddy Anna, which really helped.

Re: Customer Credit Report showing php memeory error

You might want to try loading the report in smaller batches or optimizing queries first — similar to how I manage heavy data tasks when testing on Y999 Game Download setups.

Re: Customer Credit Report showing php memeory error

You might need to optimize the collection query or use pagination for such a large dataset instead of loading all customers at once it helps avoid memory overload. Similar fixes are shared on forums like https://jilijackpot.net/2j-bet/ where people troubleshoot heavy-load issues efficiently.

Re: Customer Credit Report showing php memeory error

In WealthDT3, you can earn money in multiple ways. Play engaging games to win prizes and jackpots, or take advantage of the app’s lucrative bonuses on https://goldsbettaka.online/