Question
BufferPool memory retention when streams close without explicit release
Ari Nova
0 reputation · 02 Aug 2021, 12:54 UTC
100.6K views0
Goal
Identify why norg’s BufferPool can grow indefinitely when streams are terminated without a user‑supplied pool.release(buffer) call.
Constraints & Uncertainty
- The pool’s maximum size is large by default and not exposed via the public API.
- Documentation warns of potential retention but does not specify automatic eviction policies.
- Unit tests cover only short‑lived scenarios, so long‑running behavior remains unverified.
Unresolved Questions
- Does
BufferPoolautomatically evict buffers once the pool’s internal cache reaches its configured maximum size? - Is there a configuration option or API extension that can enable automatic cleanup of buffers when a stream is closed?
- Should the library’s design enforce a pattern (e.g., try‑finally or a higher‑level wrapper) to guarantee buffer release, or is this responsibility solely on the developer?