Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
add comment

1 Answer 1

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 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 at 18:41
    
The documentation in php.net talk about This sets the maximum amount of memory in bytes that a script is allowed to allocate. –  Giovanni Nervi Jan 21 at 18:45
    
anyway for limit process memory do I need to use ulimit? php can't help me. –  Giovanni Nervi Jan 21 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 at 18:51
show 3 more comments

Your Answer

 
discard

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.