[CentOS] strange memory issues with CentOS 6.2 on VPS

Mon Feb 27 11:57:07 UTC 2012
Tomas Vondra <tv at fuzzy.cz>

On 27 Únor 2012, 11:26, Peter Kjellström wrote:
> On Sunday 26 February 2012 19.59.07 Tomas Vondra wrote:
> ...
>> i.e. about 200 MB of free memory, but apache fails because of segfaults
>> when forking a child process:
>>
>>   [16:49:51 2012] [error] (12)Cannot allocate memory: fork: Unable to
>>                           fork new process
>>   [16:51:17 2012] [notice] child pid 2577 exit signal Segmentation
>>                            fault (11)
>
> In general things can get quite bad with relatively high memory pressure
> and
> no swap.

Sure, but there's no such pressure. There was almost 200MB of "free"
memory (used for page cache, not dirty thus easy to drop).

> That said, one thing that comes to mind is stacksize. When forking the
> linux
> kernel needs whatever the current stacksize is to be available as (free +
> free
> swap).
>
> Also, just because you see Y bytes free doesn't mean you can successfully
> malloc that much (fragmentation, memory zones, etc.).

Yup, I'm aware of that. But it's rather improbable, especially given the
other symptoms.

Update: After submitting the original post, I've noticed that these issues
probably started about a week ago after upgrading a kernel and several
related packages. I've had a swap there and the issues were not as severe,
so I haven't noticed that before. I do remember I got an OOM error during
that upgrade and I thought I've dealt with it properly, but maybe not. So
I've reinstalled (remove+install) all those packages, rebooted and the
problems disappeared. I will check that in the evening, but hopefully it's
fixed.

kind regards