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
Server Fault is a question and answer site for system and network administrators. It only takes a minute to sign up.
Sign up to join this communityFrom 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.
memory_limit = -1
Simply means to "have no memory limit" meaning: let the script use whatever is left over from the operating system and other important processes running. So if the machine has 4GIG and the OS + other processes use 2GIG, then your script will get the remaining 2GIG.
From the official docs and the important part is the last sentence!
memory_limit int
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.
By memory i mean "RAM & Virtual mem"
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.