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