2.8.7. memory_limit
About parameter
Parameter memory_limit sets the maximum amount of memory that site scripts can use. It helps to prevent situations when poorly written scripts consume all available server memory.
How the limit works
Installed for memory_limit the amount of memory is allocated for each running script separately, so the simultaneous launch of several scripts cannot consume all the allocated memory_limit, but can consume the entire RAM of the hosting account (can be seen at charts consumption of server resources). It is important to understand that when running the script, the amount of memory allocated under the memory limit_limit, not "pickedup" from RAM. Memory is allocated gradually as it is consumed by each script, but cannot exceed the specified limit, therefore the opinion that by running two scripts with the value of memory_A limit of 1024 MB will be used immediately by 2048 MB, which is fundamentally wrong.
Determine in advance how much memory or what memory limit_limit is required by a site or a script, it is almost impossible, since it all depends on the quality of the scripts themselves and the amount of data they process.
Parameter value
- Does not affect the speed of the scripts.
- The maximum value depends on the used tariff:
- On a regular hosting: from 512 to 1536 MB.
- On businesshosting — within the limits of the amount of RAM available at the tariff.
Customization
- Open the section "PHP settings" the site for which you want to change the parameter value.
-
- Available values - from 1 MB to the maximum available in the current tariff.
- If you specify 0, after saving the value will be equal to the maximum available in the current tariff.
- Wait approximately 10-15 minutes for the changes to take effect.
Increase
Attention!
Purchase of additional services Memcache(d), Redis or OPcache does not increase memory value_limit.On an ongoing basis:
- By transition the tariff is higher.
- By changes memory values_limit in PHP settings site, if the size of the error is indicated in the text of the error smaller available at the current rate.