PANIC: could not flush dirty data: Cannot allocate memory - Mailing list pgsql-general

From klaus.mailinglists@pernau.at
Subject PANIC: could not flush dirty data: Cannot allocate memory
Date
Msg-id ec01f7af535c0c38711a317cba2aa310@pernau.at
Whole thread Raw
Responses Re: PANIC: could not flush dirty data: Cannot allocate memory  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: PANIC: could not flush dirty data: Cannot allocate memory  (Christoph Moench-Tegeder <cmt@burggraben.net>)
List pgsql-general
Hi all!

We have a setup with a master and plenty of logical replication slaves. 
Master and slaves are 12.12-1.pgdg22.04+1 runnning on Ubuntu 22.04.
SELECT pg_size_pretty( pg_database_size('regdns') ); is from 25GB (fresh 
installed slave) to 42GB (probably bloat)

Replication slaves VMs have between 22G and 48G RAM, most have 48G RAM.

We are using:
maintenance_work_mem = 128MB
work_mem = 64MB

and VMs with 48G RAM:
effective_cache_size = 8192MB
shared_buffers = 6144MB

and VMs with 22G RAM:
effective_cache_size = 4096MB
shared_buffers = 2048MB

On several servers we see the error message: PANIC:  could not flush 
dirty data: Cannot allocate memory

Unfortunately I do not find any reference to this kind of error. Can you 
please describe what happens here in detail? Is it related to server 
memory? Or our memory settings? I am not so surprised that it happens 
with the 22G RAM VM. It is not happening on our 32G RAM VMs. But it also 
happens on some of the 48G RAM VMs which should have plenty of RAM 
available:
# free -h
                total        used        free      shared  buff/cache   
available
Mem:            47Gi         9Gi       1.2Gi       6.1Gi        35Gi     
    30Gi
Swap:          7.8Gi       3.0Gi       4.9Gi

Of course I could upgrade all our VMs and then wait and see if it solved 
the problem. But I would like to understand what is happening here 
before spending $$$.

Thanks
Klaus




pgsql-general by date:

Previous
From: Karsten Hilbert
Date:
Subject: Re: Q: fixing collation version mismatches
Next
From: Tom Lane
Date:
Subject: Re: PANIC: could not flush dirty data: Cannot allocate memory