-
Notifications
You must be signed in to change notification settings - Fork 519
Fix unreleased buffer in LimitScanResponse and evaluate client-side zero-copy OOM risk #2998
Description
Search before asking
- I searched in the issues and found nothing similar.
Description
PR #2948 implements zero-copy for the client side (Netty buffer to application). However, LimitScanResponse is marked as isLazilyParsed but does not explicitly release the byte buffer, which may lead to memory leaks.
Concurrently, we are addressing a series of client-side OOM issues related to direct memory in #2663. Direct memory is a scarce resource; for instance, Flink TaskManagers typically allocate only tens of megabytes, making them highly susceptible to OOM errors. Therefore, in #2663, we are refining memory management and leveraging heap memory to reduce reliance on direct memory.
Regarding PR #2948, since CompleteFetch holds the Netty byte buffer until it is consumed, high traffic or backpressure scenarios could trigger client-side direct memory OOMs. Consequently, we need to re-evaluate the impact of this PR on stability. @loserwang1024 will test whether this PR introduces any OOM risks.
Willingness to contribute
- I'm willing to submit a PR!