apache / apache/bookkeeper

Bookie GC pressure when use ReadEntryProcessorV3

Open
#3,428 1 comment 0 reactions 0 assignees View on GitHub
type/bug
Dominant language
Java
Stars
2k
Forks
976
Avg merge
6d 15h
Merged PRs (30d)
7

Description

**BUG REPORT**
When we get entry from bookie in ReadEntryProcessorV3#readEntry, the response is DirectByteBuf, the v3 use proto buf response. So it will copy byte array to proto buf builder, it will use heap memory.

If the user read request is frequent, it will introduce gc pressure.

https://github.com/apache/bookkeeper/blob/ca7d7c23e3aa572befeb447157b3ef9d96bb1449/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/ReadEntryProcessorV3.java#L179

```
public static ByteString copyFrom(ByteBuffer bytes, int size) {
checkRange(0, size, bytes.remaining());
byte[] copy = new byte[size];
bytes.get(copy);
return new LiteralByteString(copy);
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.