Andres Freund <and...@anarazel.de> writes: > The most glaring case is the RelationInitTableAccessMethod() call in > RelationBuildLocalRelation(). Seems like the best fix is to just move > the MemoryContextSwitchTo() to just before the > RelationInitTableAccessMethod(). Although I wonder if we shouldn't go > further, and move it to much earlier, somewhere after the rd_rel > allocation.
Yeah, same thing I did locally. Not sure if it's worth working harder. > There's plenty other hits, but I think I should get back to working on > making the shared memory stats patch committable. I really wouldn't want > it to slip yet another year. +1, so far there's little indication that we're finding any serious leaks here. Might be best to set it all aside till there's more time. regards, tom lane