Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit28f6e20

Browse files
committed
Fix shmem allocation size.
MaxBackends is still 0 when _PG_init() is called, which means that wedon't request enough memory in RequestAddinShmemSpace(), while the rest ofthe code sees (and allocate) a correct value.It's technically usually not a problem as postgres adds an extra 100kB ofmemory for small unaccounted memory usage, but it's better to avoid relying onit too much.Note that the value is still not guaranteed to be exact as other modules_PG_init() could later change the underlying GUCs, but there is not availableAPI to handle that case accurately.
1 parent59cfadb commit28f6e20

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

‎pg_wait_sampling.c‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717
#include"miscadmin.h"
1818
#include"optimizer/planner.h"
1919
#include"pgstat.h"
20+
#include"postmaster/autovacuum.h"
21+
#ifPG_VERSION_NUM >=120000
22+
#include"replication/walsender.h"
23+
#endif
2024
#include"storage/ipc.h"
2125
#include"storage/pg_shmem.h"
2226
#include"storage/procarray.h"
@@ -75,7 +79,12 @@ get_max_procs_count(void)
7579
intcount=0;
7680

7781
/* MyProcs, including autovacuum workers and launcher */
78-
count+=MaxBackends;
82+
count+=MaxConnections+autovacuum_max_workers+1
83+
+max_worker_processes
84+
#ifPG_VERSION_NUM >=120000
85+
+max_wal_senders
86+
#endif
87+
+1;
7988
/* AuxiliaryProcs */
8089
count+=NUM_AUXILIARY_PROCS;
8190
/* Prepared xacts */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp