Thread: Out of memory problem.

Out of memory problem.

From
Marcin Giedz
Date:
Hello...

Postgres 8.0.1 is running on Debian with 2.6.10 kernel with 12GB of RAM,
where 2GB is for shared memory:

echo 2147483648 > /proc/sys/kernel/shmall
echo 2147483648 > /proc/sys/kernel/shmmax

Also overcommit_memory is changed to not "overcommit":

pgsql1:/mnt/var# cat /proc/sys/vm/overcommit_memory
2
pgsql1:/mnt/var#

but still "out of memory" occures. "shared_buffers" parameter is set to
100000 (according to someone settings can be from 15% to 30% of total
RAM memory) - as you can see I have even below 15% of RAM. Earlier
"shared_buufers" was set to 50000 and I havn't had this problem. Why I
still have "out of memory" despite of changing not overcommit_memory?

Thx,
Marcin

Here is a problem's log

Apr 15 14:17:35 pgsql1 kernel: oom-killer: gfp_mask=0x4d0
Apr 15 14:17:35 pgsql1 kernel: DMA per-cpu:
Apr 15 14:17:35 pgsql1 kernel: cpu 0 hot: low 2, high 6, batch 1
Apr 15 14:17:35 pgsql1 kernel: cpu 0 cold: low 0, high 2, batch 1
Apr 15 14:17:35 pgsql1 kernel: cpu 1 hot: low 2, high 6, batch 1
Apr 15 14:17:35 pgsql1 kernel: cpu 1 cold: low 0, high 2, batch 1
Apr 15 14:17:35 pgsql1 kernel: cpu 2 hot: low 2, high 6, batch 1
Apr 15 14:17:35 pgsql1 kernel: cpu 2 cold: low 0, high 2, batch 1
Apr 15 14:17:35 pgsql1 kernel: cpu 3 hot: low 2, high 6, batch 1
Apr 15 14:17:35 pgsql1 kernel: cpu 3 cold: low 0, high 2, batch 1
Apr 15 14:17:35 pgsql1 kernel: Normal per-cpu:
Apr 15 14:17:35 pgsql1 kernel: cpu 0 hot: low 32, high 96, batch 16
Apr 15 14:17:36 pgsql1 kernel: cpu 0 cold: low 0, high 32, batch 16
Apr 15 14:17:36 pgsql1 kernel: cpu 1 hot: low 32, high 96, batch 16
Apr 15 14:17:36 pgsql1 kernel: cpu 1 cold: low 0, high 32, batch 16
Apr 15 14:17:36 pgsql1 kernel: cpu 2 hot: low 32, high 96, batch 16
Apr 15 14:17:36 pgsql1 kernel: cpu 2 cold: low 0, high 32, batch 16
Apr 15 14:17:36 pgsql1 kernel: cpu 3 hot: low 32, high 96, batch 16
Apr 15 14:17:36 pgsql1 kernel: cpu 3 cold: low 0, high 32, batch 16
Apr 15 14:17:36 pgsql1 kernel: HighMem per-cpu:
Apr 15 14:17:36 pgsql1 kernel: cpu 0 hot: low 32, high 96, batch 16
Apr 15 14:17:36 pgsql1 kernel: cpu 0 cold: low 0, high 32, batch 16
Apr 15 14:17:36 pgsql1 kernel: cpu 1 hot: low 32, high 96, batch 16
Apr 15 14:17:36 pgsql1 kernel: cpu 1 cold: low 0, high 32, batch 16
Apr 15 14:17:36 pgsql1 kernel: cpu 2 hot: low 32, high 96, batch 16
Apr 15 14:17:36 pgsql1 kernel: cpu 2 cold: low 0, high 32, batch 16
Apr 15 14:17:36 pgsql1 kernel: cpu 3 hot: low 32, high 96, batch 16
Apr 15 14:17:36 pgsql1 kernel: cpu 3 cold: low 0, high 32, batch 16
Apr 15 14:17:36 pgsql1 kernel:
Apr 15 14:17:36 pgsql1 kernel: Free pages:        4564kB (768kB HighMem)
Apr 15 14:17:36 pgsql1 kernel: Active:2430748 inactive:487388 dirty:114
writeback:0 unstable:0 free:1141 slab:35390 mapped:636143 pagetables:160905
Apr 15 14:17:36 pgsql1 kernel: DMA free:68kB min:68kB low:84kB
high:100kB active:24kB inactive:0kB present:16384kB pages_scanned:323
all_unreclaimable? yes
Apr 15 14:17:36 pgsql1 kernel: protections[]: 0 0 0
Apr 15 14:17:36 pgsql1 kernel: Normal free:3728kB min:3756kB low:4692kB
high:5632kB active:496kB inactive:13072kB present:901120kB
pages_scanned:19471 all_unreclaimable? yes
Apr 15 14:17:36 pgsql1 kernel: protections[]: 0 0 0
Apr 15 14:17:36 pgsql1 kernel: HighMem free:840kB min:512kB low:640kB
high:768kB active:9722344kB inactive:1936480kB present:12189696kB
pages_scanned:0 all_unreclaimable? no
Apr 15 14:17:36 pgsql1 kernel: protections[]: 0 0 0
Apr 15 14:17:36 pgsql1 kernel: DMA: 1*4kB 0*8kB 0*16kB 0*32kB 1*64kB
0*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 68kB
Apr 15 14:17:36 pgsql1 kernel: Normal: 0*4kB 0*8kB 1*16kB 0*32kB 2*64kB
0*128kB 4*256kB 1*512kB 0*1024kB 1*2048kB 0*4096kB = 3728kB
Apr 15 14:17:36 pgsql1 kernel: HighMem: 30*4kB 1*8kB 12*16kB 0*32kB
0*64kB 0*128kB 0*256kB 1*512kB 0*1024kB 0*2048kB 0*4096kB = 832kB
Apr 15 14:17:36 pgsql1 kernel: Swap cache: add 5948181, delete 5879764,
find 2114291/2758769, race 1+19
Apr 15 14:17:36 pgsql1 kernel: Out of Memory: Killed process 20553
(postmaster).
Apr 15 14:46:20 pgsql1 -- MARK --
pgsql1:/mnt/var#


Re: Out of memory problem.

From
Tom Lane
Date:
Marcin Giedz <marcin.giedz@eulerhermes.pl> writes:
> Why I still have "out of memory" despite of changing not
> overcommit_memory?

Because the 2.6.10 kernel is buggy :-(  See this thread:
http://archives.postgresql.org/pgsql-general/2005-04/msg00342.php

            regards, tom lane

Re: Out of memory problem.

From
Marcin Giedz
Date:
Użytkownik Tom Lane napisał:

>Marcin Giedz <marcin.giedz@eulerhermes.pl> writes:
>
>
>>Why I still have "out of memory" despite of changing not
>>overcommit_memory?
>>
>>
>
>Because the 2.6.10 kernel is buggy :-(  See this thread:
>http://archives.postgresql.org/pgsql-general/2005-04/msg00342.php
>
>

OK Thankx....
But what is the best kernel version to work with postgres 8.0.x? This
thread didn't resolve the problem.

Thx,
Marcin

>            regards, tom lane
>
>---------------------------(end of broadcast)---------------------------
>TIP 7: don't forget to increase your free space map settings
>
>
>


Re: Out of memory problem.

From
Scott Marlowe
Date:
On Sat, 2005-04-16 at 00:35, Marcin Giedz wrote:
> Użytkownik Tom Lane napisał:
>
> >Marcin Giedz <marcin.giedz@eulerhermes.pl> writes:
> >
> >
> >>Why I still have "out of memory" despite of changing not
> >>overcommit_memory?
> >>
> >>
> >
> >Because the 2.6.10 kernel is buggy :-(  See this thread:
> >http://archives.postgresql.org/pgsql-general/2005-04/msg00342.php
> >
> >
>
> OK Thankx....
> But what is the best kernel version to work with postgres 8.0.x? This
> thread didn't resolve the problem.

As a die hard linux user and booster, I'm still gonna have to say, the
BSD kernel.  No joke there.

Barring that, the 2.4.21 series kernel that our version of RHEL runs on
is quite stable.

I'm not sure I trust the 2.6 series kernel for production just yet.