materix — 2012-05-22T11:49:44-04:00 — #1
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?
dklynn — 2012-05-23T01:02:16-04:00 — #2
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.
materix — 2012-05-23T07:50:07-04:00 — #3
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?
scallioxtx — 2012-05-23T18:49:48-04:00 — #4
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.
spacephoenix — 2012-05-24T02:30:45-04:00 — #5
That looks suspiciously like a php error. Are you running php? Is it always the same script that's causing the error?