krichy@tvnetwork.hu writes:
> We have run into a case where we run a long transaction, and during the
> transaction the backend process's memory usage is growing constantly.
> [ test program just inserts and immediately deletes rows ]
I see a leakage of about 40 bytes per cycle in this example, arising from
the need to track a "combo cid" for each deleted row. This is the price
we pay for combining insertion and deletion CIDs into one field on disk.
The memory will be reclaimed at end of transaction ... so the short answer
is close out your transaction occasionally. Extremely long transactions
like this will cause you headaches in a number of other ways too, like
inability to reclaim disk space.
regards, tom lane