Hi Kirill,. On Fri, Jul 3, 2026 at 5:20 AM Kirill Reshke <[email protected]> wrote: > > I was debugging the GIN index issue today and noticed my postgresql > session which I used to run amcheck eats too much memory. PFA fix.
Thanks for the patch — I reproduced the problem and confirm the fix works well. prev_tuple is refreshed via CopyIndexTuple() each iteration but never freed, and since the whole entry-tree traversal runs in one memory context, the copies pile up (~one per entry-tree tuple) until the function returns. Your pfree() fixes that. One optional follow-up: the last prev_tuple of each page is still left behind (reset to NULL on the next page, never freed in the while cleanup). +1 from me. > > > > -- > Best regards, > Kirill Reshke -- Regards, Ewan Young
