Oh, I take that back --- I misread where you'd put the free()s.
Hmm, so the point is to reclaim memory during a shmem reinit cycle?Might be worth doing, but I fear this is unlikely to be the only suchleakage ...
regards, tom lane