My httpd-error.log file has many entries like :

Out of memory

Out of memory

Out of memory

How is anyone able to even start debuging that? It contains no useful information whatsoever.

My server had 8gb ram and 'top' shows I still have 5.1gb available.

I watched the apache (prefork) process grow to 41mb - and then it went to 100% CPU usage for about 10 seconds - and then the process died.

Any suggestions on how I can start to figure out what is causing this?

  • Could you tell us how many sites you have and visitors .. ?? – ntrance Dec 3 '10 at 7:43
  • If i didnt know how many site you have on your server , how many client you have what is your sites what they make how i can Help you ???? Am not magicia man to know what is your configuration and etc. You have to answer this question to help you. Maybe some php script bloke your apache2 ... – ntrance Dec 3 '10 at 7:57
  • I host 7 sites - which most of the traffic is handled by nginx (all static files). Anything php is proxied over to apache .. – Brian Smith Dec 3 '10 at 8:40
  • This might be a stupid question, but have you checked your disk space (df)? – Andrew M. Dec 3 '10 at 13:12
  • yes - tmp, usr, var has lots of space free. – Brian Smith Dec 5 '10 at 23:20

First of all, many different things can write to the apache error log -- not just apache itself, but also modules or other components used in serving a specific request. It may not be apache running out of memory.

Second, also bear in mind that while 32-bit Linux can address memory beyond the 4GB barrier by using PAE, that doesn't give any larger address space to individual 32-bit programs. Each program is still stuck inside the confines of its 32-bit address space. So while your system may have free memory, apache may not. You need to be running 64-bit apache on a 64-bit kernel with 64-bit extensions, modules, etc.

  • The server is running on FreeBSD 7.3 64 bit (7.3-RELEASE-p2), AMD64 kernel & everything on the server was compiled via ports system. 'Top' shows as follows : Mem: 354M Active, 1806M Inact, 630M Wired, 1120K Cache, 811M Buf, 4953M Free - Swap: 2048M Total, 2048M Free – Brian Smith Dec 3 '10 at 11:23

You've not provided a lot of information about your system nor its usage.

What OS is it running on?

Is it just serving up static content or is there custom code involved? If so, does it run in-process (e.g. mod_php) or via fastCGI, or something else....?

A common cause of this problem is running unconstrained queries against a database from PHP - although the PHP interpreter has (and respects) a config option for memory usage, most of the database client libs are unaware of this when marshalling data returned by a server.

Since you are using a pre-fork server, the likelihood of a memory leak is significantly reduced - but what are your keepalive settings?

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.