2.8.8. memory_limit
About parameter
The memory_limit parameter specifies the maximum amount of memory that site scripts can use. It helps prevent situations where poorly written scripts consume all of the server's available memory.
How limit works
The memory_limit value is allocated separately for each running script; therefore, running multiple scripts simultaneously cannot consume the entire memory_limit allocation, but it can consume all of the hosting account's RAM (this can be seen in the charts showing server resource usage). It is important to understand that when a script is launched, the amount of memory allocated under the memory_limit is not "taken" from the RAM. Memory is allocated gradually as it is consumed by each script, but cannot exceed the specified limit; therefore, the notion that running two scripts with a memory_limit of 1024 MB will immediately use 2048 MB is fundamentally incorrect.
It is practically impossible to determine beforehand how much memory or what memory_limit value a site or script will require, since it all depends on the quality of the scripts themselves and the amount of data they process.
Parameter value
- Does not affect script performance.
- The maximum value depends on the plan you are using:
- On shared hosting: from 512 to 1536 MB.
- On business hosting — within the RAM limit included in your plan.
Configure
- Open the "PHP settings" section of the site for which you need to change the parameter value.
- Specify the desired value next to "php_memory_limit" and click "Save" at the bottom of the page:

- Available values — from 1 MB up to the maximum allowed under your current plan.
- If you enter 0, the value will be set to the maximum allowed under your current plan after saving.
- Wait approximately 10-15 minutes for the changes to take effect.
Increase
Attention!
Purchasing extra services such as Memcached, Redis, or OPcache does not increase the memory_limit value.On a permanent basis:
- By upgrading to a higher plan.
- By changing the memory_limit value in the site's PHP settings, if the error message specifies a value less than what is available in your current plan.
Comments