Apache: Out of memory

We run Apache on Windows server.

We often get this error message in the log files: Fatal: Out of memory (allocated 3670016) (tried to allocate 2621440 bytes).

The server has a lot of free memory. How do i “allocate” more memory to Apache?

materix,

Actually, it may not have a lot of free memory! Please remember that Apache runs a number of children at any one time (some to handle requests and others to listen for incoming requests). When you have a memory hog application running, it will limit the other children and, if one of them get the same request, it could easily cause a memory problem.

How to handle it? The first step is to contact your host (who will likely try to upsell their services - as this may be your only way out) but they may have a way to throttle the requests on the memory hog request, too.

Regards,

DK

David, thanks for the reply.

I forgot to mention that this is a virtual windows server, which we have full control over. It has 6 GB of memory, most of it is not used.

Normally the Apache process only uses about 250 Mb of memory, but still gives out of memory errors. Is there perhaps some memory limit in php.ini or httpd.conf which is set to low?

php does have a max memory limit, which is memory_limit in php.ini and is set to 128MB by default.

AFAIK Apache doesn’t have a hard memory limit but just takes more memory when needed.

That looks suspiciously like a php error. Are you running php? Is it always the same script that’s causing the error?