This problem can occur if runtime filter expressions that are evaluated in the scan allocate temporary memory - "local allocations". These accumulate for each scan range and are only
freed upon scan range completion.
A contrived query that exhibits the problem is the following. If I continue adding upper() and lower() to the expression the memory consumption of the scan node will continue to grow - up to 100MB for each extra function call!
I think other conjuncts in the scanner may be affected by the same problem, e.g. the min_max conjuncts.