This error(Allowed memory size of 2147483648 bytes exhausted (tried to allocate 20480 bytes) in vendor/magento/framework/Serialize/Serializer/Json.php on line 37) is populated when we access the category page (this category is top level category which shows all products (we have only 20-24 configurable products)). Not each time but it come after 10-12 days interval on the production environment.

We recently upgraded our server memory from 4g to 8g to solve this issue but it is still there.

We use nginx and php-fpm

We also updated the memory limit from .user.ini file from both the location m2 root and Pub

Thanks in advance.

  • I am also having the same issue, could you plz suggest how you solved your problem. Sep 6, 2023 at 12:28

2 Answers 2


As per the error report, you set memory_limit 2G (2147483648 bytes). Increase to 3G or 4G maybe fix the issue. Make sure memory_limit is updated properly using phpinfo().

enter image description here

Local value is the final memory limit value.

Also, we can add ini_set('memory_limit', '-1'); in PHP, telling the server to just use all the memory that it wants.

Changing the memory_limit by ini_set('memory_limit', '-1'); is not a proper solution. Try using Xdebug to profile your script and find out where all that memory went and fix the issue.


we have the error for ...StoreRepository.php on line 112

But what ever limit is set as local and global value (6G), the error returns

Seems to be something else...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.