Forum OpenACS Q&A: Server shutdown

Posted by Nima Mazloumi on
The server shut down after this entry in the log:
unable to alloc 25673402 bytes

Any idea, what has to be done?

2: Re: Server shutdown (response to 1)
Posted by Gustaf Neumann on
The message says that the server tried to allocate on the C-level a data chunk of 25MB. There are 2 kinds of questions: (a) why was the server trying to allocate such much (additional) memory and (b) why was the operating system (i assume linux) was not giving the memory to the aolserver. One cannot provide an answer to (a) and (b) without more information.

The answer to (a) lies in the request (or scheduled proc) currently executing. You should check this. Was the server issuing an exec?

Concerning (b) there are two potential sources. You are running out of the address space of a single process (2 GB with 32-bit compiled binaries on Linux) or the machine was in general running out of memory. It would be interesting to know, how large the server was at the time of the crash. Keep in mind, that all threads of the aolserver are running within one 2GB address space (for 32-bit compiled code).

You can do several things to keep under the 2GB mark:
- reduce the number of connection threads configured
- reduce the number of packages loaded
- avoid the calls to exec
- daily restarts of the server

You can remove the 2GB limit by compiling aolserver as a 64 bit binary (all components have to be compiled this way, from tcl ... nspostgres ...)

If the machine is running out of memory, well, adding more memory or swap space might help. Maybe the problem is coming from some other processes running wild on the machine, eating up all resources, so moving these away might help...

-gustaf neumann
PS: looks like a good candidate for a FAQ.