Joomla is a popular content management system (CMS) that allows users to create and manage websites. However, like any other software, Joomla can sometimes encounter issues that can be frustrating for users. One of the most common issues that Joomla users face is the “Allowed memory size of x bytes exhausted: Joomla fatal error”. In this blog, we will discuss what this error means, why it occurs, and how to fix it.
What does the “Allowed memory size of x bytes exhausted: Joomla fatal error” mean?
The “Allowed memory size of x bytes exhausted” error occurs when PHP runs out of memory while processing a request. This error message indicates that the amount of memory that Joomla is allowed to use has been exceeded, and it cannot continue executing the current script. The “x” in the error message refers to the specific amount of memory that Joomla was trying to use when the error occurred.
For example, if your available memory is limited to 128 MB (134217728 bytes) but the PHP needs more memory to run your scripts, the error will happen.
Why does the “Allowed memory size of x bytes exhausted: Joomla fatal error” occur?
The “Allowed memory size of x bytes exhausted” error can occur for several reasons, including:
- Running too many extensions or plugins – Joomla has many extensions and plugins that can be added to the platform to add more functionality to the site. However, running too many of them can cause the system to use up all available memory, resulting in this error.
- Large file uploads – Uploading large files, such as images or videos, can use up a lot of memory, especially if the server doesn’t have enough RAM.
- High website traffic – If your site receives a lot of traffic, Joomla may not have enough memory to handle all the requests at once, resulting in this error.
How to fix the “Allowed memory size of x bytes exhausted: Joomla fatal error”?
Actually, there are numerous ways to deal with the “Allowed memory size of x bytes exhausted: Joomla fatal error”, depending on what’s causing the issue. Here are a few popular solutions:
Increase PHP memory limit
- Change PHP memory limit in the php.ini file: This way requires you to access and increase the value of memory_limit. So, simply go to php.ini file -> edit the value of memory_limit from the original value to a larger one -> restart the PHP server.
- Increase PHP memory limit in the .htaccess file: You can also fix this issue by editing your .htaccess file. In order to do this, let’s open the file manager -> public_html directory -> .htaccess -> right-click -> edit -> add the code to the .htaccess file:
php_value memory_limit yM
Remember to change “y” into the larger amount value compared with the original value.
- Update PHP memory limit at the code level: The error can be fixed by inserting the code below to the beginning of your index.php. Please note that it is in the root directory of your Joomla site, and don’t add the code to your configuration.php:
Don’t forget to edit “y” value into a larger amount value.
Disable unnecessary extensions or plugins
As you know, Joomla has a wide range of extensions and plugins that can add additional functionality to your website. However, running too many of these can consume a significant amount of memory, which can result in an error message. Let’s follow the steps below to address the “Allowed memory size of x bytes exhausted: Joomla fatal error”:
- Log in to your Joomla Administrator panel using your admin credentials. Click on the System -> Extensions (in the Manage tab).
- On the Manage page, you will see a list of all the installed extensions and plugins. You can filter the list by selecting the type of extension you want to disable. To disable an extension or plugin, simply click on the green checkmark in the Enabled column. The checkmark will turn into a red X, indicating that the extension or plugin is now disabled.
- Once you have disabled all the unnecessary extensions or plugins, go back to your website and check if the error message still appears.
Images are an essential part of any website, but they can also consume a significant amount of memory. If you have too many high-resolution images or images that are not optimized for the web, it can lead to the “Allowed Memory Size of x Bytes Exhausted: Joomla fatal error” message.
In order to optimize images to solve this issue, you can use WordPress Optimize Images Plugins and follow the guide on how to optimize images in WordPress here.
Upgrade your hosting plan
Sometimes, the “Allowed memory size of x bytes exhausted: Joomla fatal error” can occur if your website has outgrown your current hosting plan. If your website is receiving a lot of traffic or running resource-intensive applications, you may need to upgrade your hosting plan to a higher-tier plan that provides more resources, including more memory.
Here are the steps to upgrade your hosting plan in Joomla:
- Contact your web hosting provider and inquire about their available hosting plans. Many hosting providers offer a range of plans with varying levels of resources and features.
- Select the hosting plan that meets your website’s needs, considering factors like traffic, the number of applications running, and storage requirements.
- Once you have selected the new hosting plan, your hosting provider will guide you through the migration process. This may involve backing up your website, moving it to the new server, and configuring the new hosting environment.
- After your website has been migrated to the new hosting plan, monitor it closely to ensure that the “Allowed memory size of x bytes exhausted” error does not occur again. You may need to tweak some settings or optimize your website further to fully utilize the additional resources provided by the new hosting plan.
If you are using WordPress and also facing the same issue, you can get more information about how to deal with Fatal error: allowed memory size of 134217728 bytes exhausted or Fatal error allowed memory size of 67108864 bytes exhausted here.
The “Allowed memory size of x bytes exhausted: Joomla fatal error” can be frustrating, but it’s a common issue in Joomla that can be fixed with the solutions listed above. By optimizing your site and managing your extensions and plugins, you can prevent this error from occurring and keep your Joomla site running smoothly.
Furthermore, don’t forget to visit our Joomla 4 Templates if you are looking for a new template for your Joomla website. We will be happy if you can get the most suitable one after exploring our collection. Thank you.
- What is PortSpeed in VPS - March 31, 2023
- 5+ Best Tablepress Alternatives (Compared) - March 30, 2023
- How to Effectively Edit and Revise Your Essay - March 30, 2023