2

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?

5
  • 1
    I must ask why your index.php requires 50 MB at all. Perhaps you should be doing something else? Commented Nov 20, 2011 at 13:11
  • Short answer yes... why are you not caching the generated page? Commented Nov 20, 2011 at 13:11
  • 2
    Close-Voter, How is this off-topic? Commented Nov 20, 2011 at 13:12
  • @JohnChadwick because it's a BuddyPress and is using an old theme, never updated... Commented Nov 20, 2011 at 13:22
  • @LawrenceCherone sure, I am planning to install w3 total cache and further xcache. Commented Nov 20, 2011 at 13:25

2 Answers 2

3

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.

Sign up to request clarification or add additional context in comments.

Comments

0

memory_limit limits memory usage for script per one request

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.