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 c37be39 commit 016e407Copy full SHA for 016e407
contrib/pg_prewarm/autoprewarm.c
@@ -693,8 +693,15 @@ apw_dump_now(bool is_bgworker, bool dump_unlogged)
693
return 0;
694
}
695
696
- block_info_array =
697
- (BlockInfoRecord *) palloc(sizeof(BlockInfoRecord) * NBuffers);
+ /*
+ * With sufficiently large shared_buffers, allocation will exceed 1GB, so
698
+ * allow for a huge allocation to prevent outright failure.
699
+ *
700
+ * (In the future, it might be a good idea to redesign this to use a more
701
+ * memory-efficient data structure.)
702
+ */
703
+ block_info_array = (BlockInfoRecord *)
704
+ palloc_extended((sizeof(BlockInfoRecord) * NBuffers), MCXT_ALLOC_HUGE);
705
706
for (num_blocks = 0, i = 0; i < NBuffers; i++)
707
{
0 commit comments