3

I was in some ubuntu server configs, and found that my memory on the server (online resources say default is usually 128Mb correct?)

and I found this listed

memory_limit = -1

Why? What does a value of -1 do? Php of 5.6

7

From the official documantation here:

This sets the maximum amount of memory in bytes that a script is allowed to allocate. This helps prevent poorly written scripts for eating up all available memory on a server. Note that to have no memory limit, set this directive to -1.

-1

Don't do that. Obviously php has a memory leak somewhere and you are telling the server to just use all the memory that it wants. The problem has not been fixed at all. If you monitor your server, you will see that it is now probably using up most of the RAM and even swapping to disk.

  • 3
    OP gives no indication in their question that there's a problem of any kind they're investigating - they could've just noticed it in the config and been curious. You're jumping to some unfounded conclusions. – ceejayoz Mar 29 '17 at 18:43
  • Yes, is true. I did not have a problem and was curious. Although I agree with the proposed answer because he/she does make a point to monitor server if I did have a problem. – camdixon Mar 29 '17 at 21:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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