Repository navigation
Description
Is there an existing issue for the same bug?
- I have checked the existing issues (searched for
serialBuf WriteArenaandarena memory object writer).
Branch Name
4.2-dev (source code inspected; exact branch of the running DN has not been verified)
Commit ID
5c79c3b (local source checkout; running binary build ID: 218cecaaacdbffcc7240c7df4c52dc59ba530924)
Other Environment Information
- MatrixOne DN in the IDC
mo-new-moienvironment, 2026-09-26 08:19 CST. - DN Go heap
inuse_spaceprofile: 6,491.17 MiB total. - The profile itself is not attached because it may contain deployment information; relevant aggregate output is quoted below.
Actual Behavior
An in-use DN heap profile attributes 1,293.22 MiB (19.92% of sampled in-use heap) to objectio.(*objectWriterV1).addBlock -> bytes.(*Buffer).Grow. The bytes.growSlice flat total is 1,324.23 MiB; the remaining ~31 MiB may have other callers.
The writer serializes each column into WriteArena.serialBuf when an arena is present. bytes.Buffer.Reset() clears the length but retains capacity. WriteArena.Reset() does not shrink serialBuf, and PutArena() can retain the arena in a free list. The pool limits the number of arenas, but does not limit their aggregate serialBuf capacity. Thus a large serialized column may leave a large Go-heap backing array retained across later write cycles, including idle periods while the pool remains warm. This is separate from the off-heap WriteArena.data and compressBuf allocations.
The profile identifies the allocation path; it does not show how much of the 1,293 MiB is currently in active writers versus pooled arenas. It also does not establish that these buffers alone caused the observed DN RSS pressure or merge throttling.
Expected Behavior
Reusable serialization buffers should have a bounded retained capacity or be released when disproportionate to normal write sizes. Pool memory should be observable so active and idle retention can be distinguished.
Steps to Reproduce
- On a non-production DN, run a write/flush/merge workload containing sufficiently large column vectors so
objectWriterV1.addBlockgrowsserialBufsubstantially. - Let the corresponding writers return their arenas to the pool; keep normal checkpoint activity running so the 10-minute arena-drain timer continues to be reset.
- Capture Go heap
inuse_space, force GC if appropriate for the experiment, and inspectbytes.(*Buffer).Grow/objectWriterV1.addBlockallocations and retained heap. Compare before and after a pool drain. - Record pool size and
serialBuf.Cap()for active and pooled arenas to confirm retention and quantify its contribution. These steps are a proposed controlled reproduction; they have not yet been run end to end.
Additional information
Relevant code:
pkg/objectio/writer.go:WriteArena.serialBuf;objectWriterV1.addBlockcallssbuf.Reset()andsbuf.Grow(vec.Size()+64);WriteArena.Reset()andFreeBuffers()do not explicitly reset the serialization buffer.pkg/objectio/arena_pool.go:PutArena()retains arenas up to count limits (GOMAXPROCS/2small and2*GOMAXPROCSlarge);ScheduleArenaDrain()delays draining for 10 minutes after the last scheduling call.
Profile excerpt (go tool pprof -peek=addBlock, 2026-09-26 08:19:02 CST):
File: mo-service
Type: inuse_space
Total: 6491.17MB
objectio.(*objectWriterV1).AddBlock -> objectio.(*objectWriterV1).addBlock 1293.22MB
objectio.(*objectWriterV1).addBlock -> bytes.(*Buffer).Grow 1293.22MB
Suggested investigation: measure pooled serialBuf.Cap() distribution and peak concurrent active arenas, then evaluate a maximum retained capacity or dropping oversized buffers on PutArena() while preserving write-path reuse for normal-sized vectors.
Activity
fix(objectio): bound pooled serialization buffers (#29432)
[4.2-dev] Bound pooled WriteArena serialization buffer retention (#32454
[4.2-dev] Bound pooled WriteArena serialization buffer retention (mat…