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 74637fb commit d59ff3bCopy full SHA for d59ff3b
contrib/pg_prewarm/autoprewarm.c
@@ -609,8 +609,15 @@ apw_dump_now(bool is_bgworker, bool dump_unlogged)
609
return 0;
610
}
611
612
- block_info_array =
613
- (BlockInfoRecord *) palloc(sizeof(BlockInfoRecord) * NBuffers);
+ /*
+ * With sufficiently large shared_buffers, allocation will exceed 1GB, so
614
+ * allow for a huge allocation to prevent outright failure.
615
+ *
616
+ * (In the future, it might be a good idea to redesign this to use a more
617
+ * memory-efficient data structure.)
618
+ */
619
+ block_info_array = (BlockInfoRecord *)
620
+ palloc_extended((sizeof(BlockInfoRecord) * NBuffers), MCXT_ALLOC_HUGE);
621
622
for (num_blocks = 0, i = 0; i < NBuffers; i++)
623
{
0 commit comments