laskoviymishka opened a new pull request, #762:
URL: https://github.com/apache/iceberg-go/pull/762

   Arrays returned by NewArray() have refcount=1. NewRecordBatch calls Retain() 
on each column, bumping to refcount=2. Without an explicit Release() on the 
temporary arrays, the count never drops back to 1 when the record batch is 
released by the caller.
   
   Fix by assigning NewArray() results to local variables and deferring their 
Release(), so the lifecycle is: NewArray() -> refcount 1, NewRecordBatch 
Retain() -> refcount 2, deferred Release() -> refcount 1 (owned by outData), 
caller releases outData -> refcount 0 -> freed.
   
   Also extend TestEnrichRecordsWithPosDeleteFields to use 
memory.NewCheckedAllocator with mem.AssertSize(t, 0) to catch this class of 
leak going forward.
   
   Fixes leak introduced in #721.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to