RE: Some shared memory chunks are allocated even if related processes won't start - Mailing list pgsql-hackers

From Hayato Kuroda (Fujitsu)
Subject RE: Some shared memory chunks are allocated even if related processes won't start
Date
Msg-id TYCPR01MB1207712AB0F485D7D9878F109F5232@TYCPR01MB12077.jpnprd01.prod.outlook.com
Whole thread Raw
In response to Re: Some shared memory chunks are allocated even if related processes won't start  ('Alvaro Herrera' <alvherre@alvh.no-ip.org>)
Responses Re: Some shared memory chunks are allocated even if related processes won't start
List pgsql-hackers
Dear Alvaro,

Thanks for discussing!

> 
> I think it would be worth allocating AutoVacuumShmem->av_workItems using
> dynamic shmem allocation, particularly to prevent workitems from being
> discarded just because the array is full¹; but other than that, the
> struct is just 64 bytes long so I doubt it's useful to allocate it
> dynamically.
> 
> ¹ I mean, if the array is full, just allocate another array, point to it
> from the original one, and keep going.

OK, I understood that my initial proposal is not so valuable, so I can withdraw it.

About the suggetion, you imagined AutoVacuumRequestWork() and brininsert(),
right? I agreed it sounds good, but I don't think it can be implemented by current
interface. An interface for dynamically allocating memory is GetNamedDSMSegment(),
and it returns the same shared memory region if input names are the same.
Therefore, there is no way to re-alloc the shared memory.

Best Regards,
Hayato Kuroda
FUJITSU LIMITED
https://www.fujitsu.com/ 


pgsql-hackers by date:

Previous
From: Aleksander Alekseev
Date:
Subject: Re: type cache cleanup improvements
Next
From: Magnus Hagander
Date:
Subject: Replication conflicts not processed in ClientWrite