eclipse-vertx / vertx-grpc

Development of the gRPC component for Eclipse Vert.x
Eclipse Public License 2.0
42 stars 23 forks source link

Avoid false-positive leak detection #99

Closed tsegismont closed 4 months ago

tsegismont commented 4 months ago

See #98

In most cases, the encoded message buffer is sent to the wire directly, and thus it's not GC-ed before it's actually written and released at lower level by Netty.

However, with gRPC-Web in text mode, the buffer content is base64 encoded, and the initial composite ByteBuf is never released, even if it's safe not to do so because it's neither pooled nor direct.

To avoid the false-positive detection, the composite byte buff aggregation can be replaced with Vert.x Buffer manipulation. In this part of the code, we're only dealing with un-pooled heap buffers anyway.