Search code examples
phprammemory-limitvirtual-server

PHP Memory Limit / RAM questions


I have a question regarding PHP and it's memory limit. I have an index.php page, that requires memory_limit to be set to about 50MB or more to run.

So does this mean anytime somebody visits that page it will take 50MB of RAM memory to load the page?

In other words if 2 clients are asking for the same page at the same time, the server needs 100MB of free RAM memory to serve them?


Solution

  • The answer is yes, every PHP process that runs that page will potentially require up to 50 MB of RAM.

    Having such a greedy index page is not a good thing. You're not saying what it's doing so it's impossible to give optimization tips, but consider either putting the memory-intensive tasks elsewhere, or caching the page.