Understand the difference between PHP memory limit and RAM at Hostinger, two related but distinct concepts when troubleshooting resource issues.
What is PHP memory_limit?
The PHP memory_limit setting applies to the maximum memory limit used by a single request, script, or process. This configuration helps prevent poorly written scripts from consuming all the available memory on a server. For instance, if three PHP scripts simultaneously use 100 MB of memory each, that would be 300 MB of memory in total, but it wouldn’t hit the PHP limit of 128 MB since it applies per script.
What is RAM?
RAM, or random access memory, is physical hardware in a computer or server. It stores data and instructions needed to run a process or script and makes them available. Basically, the system’s RAM allocates memory to these processes or scripts, as well as reserves some memory to ensure the proper function of other programs and services in the system.
Understanding this distinction helps clarify why a script can hit its PHP memory limit even when your server has plenty of RAM available overall, since the two operate independently.