File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -188,6 +188,17 @@ func (rows *baseRows) Close() {
188
188
} else if rows .queryTracer != nil {
189
189
rows .queryTracer .TraceQueryEnd (rows .ctx , rows .conn , TraceQueryEndData {rows .commandTag , rows .err })
190
190
}
191
+
192
+ // Zero references to other memory allocations. This allows them to be GC'd even when the Rows still referenced. In
193
+ // particular, when using pgxpool GC could be delayed as pgxpool.poolRows are allocated in large slices.
194
+ //
195
+ // https://github.com/jackc/pgx/pull/2269
196
+ rows .values = nil
197
+ rows .scanPlans = nil
198
+ rows .scanTypes = nil
199
+ rows .ctx = nil
200
+ rows .sql = ""
201
+ rows .args = nil
191
202
}
192
203
193
204
func (rows * baseRows ) CommandTag () pgconn.CommandTag {
You can’t perform that action at this time.
0 commit comments