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 09498d2 commit a4b9707Copy full SHA for a4b9707
contrib/pg_prewarm/autoprewarm.c
@@ -593,8 +593,15 @@ apw_dump_now(bool is_bgworker, bool dump_unlogged)
593
return 0;
594
}
595
596
- block_info_array =
597
- (BlockInfoRecord *) palloc(sizeof(BlockInfoRecord) * NBuffers);
+ /*
+ * With sufficiently large shared_buffers, allocation will exceed 1GB, so
598
+ * allow for a huge allocation to prevent outright failure.
599
+ *
600
+ * (In the future, it might be a good idea to redesign this to use a more
601
+ * memory-efficient data structure.)
602
+ */
603
+ block_info_array = (BlockInfoRecord *)
604
+ palloc_extended((sizeof(BlockInfoRecord) * NBuffers), MCXT_ALLOC_HUGE);
605
606
for (num_blocks = 0, i = 0; i < NBuffers; i++)
607
{
0 commit comments