Cannot allocate memory: fork: Unable to fork new process?
amazon-web-services, apache, memory-leaks, out-of-memory
Solution
I've face that problem either while hosting a java app with jenkins, mysql & tomcat on ubuntu on an vm of AWS.
First steps I used to solve the problem with restarting a vm.
AWS doesn't give swap memory on a harddrive by default, so you'd better to make it with your hands. How to do this you can find here. Need to mention: the solution with swap zone (have no idea why) haven't work for me, I had to create a swap file.
Good luck to you!
Problem
We have our hosting in `aws`. Recently after moving our blog from `wordpress` to `aws`, we are experiencing noticeable delay in server response time. Mainly while accessing the blog. Below are the logs from the `error_log` file, ``` [Wed Feb 25 06:10:10 2015] [error] (12)Cannot allocate memory: fork: Unable to fork new process [Wed Feb 25 06:12:22 2015] [error] (12)Cannot allocate memory: fork: Unable to fork new process [Wed Feb 25 06:12:36 2015] [error] (12)Cannot allocate memory: fork: Unable to fork new process [Wed Feb 25 06:12:50 2015] [error] (12)Cannot allocate memory: fork: Unable to fork new process [Wed Feb 25 06:13:35 2015] [error] (12)Cannot allocate memory: fork: Unable to fork new process [error] (12)Cannot allocate memory: fork: Unable to fork new process [Wed Feb 25 06:27:14 2015] [error] (12)Cannot allocate memory: fork: Unable to fork new process ``` We increased the memory size from 256 to 512 mb in `php.ini` file. But, still the issue exist. We also changed the KeepAlive as On. Still it doesn't resolve. Any suggestions / solutions would be of great help.