mirror of https://github.com/grpc/grpc-java.git
MessageFramer calls Drainable.drainTo with a special output stream of OutputStreamAdapter. Currently, ByteBufInputStream writes to this output stream by allocating a heapBuffer in UnsafeByteBufUtil.getBytes, copying from the direct byte buffer of BBIS, and then copies to the direct byte buffer from MessageFramer.writeRaw(). This change is an easy way to cut down on wasted memory, even though ideally there would be some way to have less copies. The actual data is only around 10 bytes, but causes O(10)s of megabytes allocation for the heap pool. For #2062 |
||
|---|---|---|
| .. | ||
| generated/main | ||
| jmh/java/io/grpc | ||
| main | ||
| test/java/io/grpc/benchmarks/driver | ||