Parameter memory_limit sets the maximum amount of memory that can be used by site scripts. Limiting the amount of memory helps prevent situations in which poorly written scripts consume all available server memory.
The memory set in this value is allocated for each running script separately, so running multiple scripts cannot consume all the allocated memory_limit, but can consume all of the allocated RAM for the hosting account, which can be seen at consumption schedules server resources. It is important to understand that when the script is run, the amount of memory allocated under the memory limit is not "taken" from the RAM_limit.
Memory is allocated depending on the consumption of each script, but cannot exceed the specified limit, because the opinion is that by running two scripts with the size of memory_limit of 1024 will consume 2048 MB at once, which is fundamentally wrong. Determine in advance how much a site or script will need allocated RAM or memory values_limit is almost impossible, since it all depends on the data they process.
Attention! If the site scripts exceed the available memory capacity, the error “Fatal error: Allowed memory size of XXX bytes exhausted (tried to allocate YYY bytes)". A description of the error and options for solving it can be found in instructions.
To change the value of memory_limit on the website, do the following: