-
Notifications
You must be signed in to change notification settings - Fork 4k
CompositeReadableBuffer and GC overhead #3278
Copy link
Copy link
Closed
Milestone
Description
What version of gRPC are you using?
What JVM are you using (java -version)?
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)
What the problem?
Small messages send and receive via gRPC lead to many memory allocation via CompositeReadableBuffer. It's top by allocation in benchmark that send 32 bytes request and receive 16 bytes response.
I think we can reduce allocation if change logic of this line https://github.com/grpc/grpc-java/blob/master/core/src/main/java/io/grpc/internal/MessageDeframer.java#L303 because in this place creates temp CompositeReadableBuffer that uncessary https://github.com/grpc/grpc-java/blob/master/core/src/main/java/io/grpc/internal/CompositeReadableBuffer.java#L51 instead of it we can write at once in target buffer.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
