8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent aad8bd6 commit 1694292Copy full SHA for 1694292
contrib/pg_prewarm/autoprewarm.c
@@ -608,8 +608,15 @@ apw_dump_now(bool is_bgworker, bool dump_unlogged)
608
return 0;
609
}
610
611
- block_info_array =
612
- (BlockInfoRecord *) palloc(sizeof(BlockInfoRecord) * NBuffers);
+ /*
+ * With sufficiently large shared_buffers, allocation will exceed 1GB, so
613
+ * allow for a huge allocation to prevent outright failure.
614
+ *
615
+ * (In the future, it might be a good idea to redesign this to use a more
616
+ * memory-efficient data structure.)
617
+ */
618
+ block_info_array = (BlockInfoRecord *)
619
+ palloc_extended((sizeof(BlockInfoRecord) * NBuffers), MCXT_ALLOC_HUGE);
620
621
for (num_blocks = 0, i = 0; i < NBuffers; i++)
622
{
0 commit comments