Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a web server apache 2.2 with fastcgi and php 5.3, I have memory limit set to 256MB in php.ini and with php-cgi -i I got 256MB. So the configurations is correct, my process read it without problem. I told this because I read many post in internet, and the problem was bad location of php.ini. In my case I'm sure is correct.

My processes php-cgi 8 plus parent allocate RSS for more of 256MB some process allocate also 700MB without problem. Why?

Which is the scope of memory limit when some processes php-cgi can allocate more of 256MB?

I tried to search for some bug, but I can't find nothing.

My application not use ini_set for override memory_limit parameter. So I'm sure the limit of 256MB should be honored.

share|improve this question

The PHP memory_limit setting is a virtual memory limit. RSS is a measure of physical memory usage. They have very little to do with each other.

The memory_limit setting sets the amount of virtual memory that a PHP script is permitted to directly allocate. It is not a process limit and it is not a physical memory limit.

share|improve this answer
with top I see also for virtual memory more of 256MB. So can you explain better which limit is memory_limit – Giovanni Nervi Jan 21 '14 at 18:40
@GiovanniNervi It's not a virtual memory limit for the process, just for one way the PHP system allocates virtual memory. (See updates.) – David Schwartz Jan 21 '14 at 18:41
The documentation in talk about This sets the maximum amount of memory in bytes that a script is allowed to allocate. – Giovanni Nervi Jan 21 '14 at 18:45
anyway for limit process memory do I need to use ulimit? php can't help me. – Giovanni Nervi Jan 21 '14 at 18:47
@GiovanniNervi It sounds like you didn't ask the question you actually wanted to ask. If you're having some kind of problem, you should describe it in as much detail as possible. (Much of the physical memory you're seeing the processes use is likely shared.) – David Schwartz Jan 21 '14 at 18:51

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.