[
https://issues.apache.org/jira/browse/HDDS-17777?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18143993#comment-18143993
]
Sergey Soldatov commented on HDDS-17777:
----------------------------------------
Closing after measuring. Using netty's internalNioBuffer saves ~128 B of
short-lived garbage per RocksDB get/encode (517 → 389 B/op in a microbenchmark
with the shaded netty 4.1.139 and rocksdbjni 10.10.1.1), but throughput is
unchanged within noise at 1–20 threads, and freon omkg showed no gain. A
bounded variant (internalNioBuffer().slice()) saves nothing because C2 already
removes the duplicate() allocation. So the only gain requires handing sources
an unbounded view at a non-zero position, where a source that assumes position
0 could silently corrupt a neighbouring pooled buffer. Not worth that contract
change.
> CodecBuffer allocates a new ByteBuffer view on every fill
> ---------------------------------------------------------
>
> Key: HDDS-17777
> URL: https://issues.apache.org/jira/browse/HDDS-17777
> Project: Apache Ozone
> Issue Type: Bug
> Components: OM
> Affects Versions: 2.2.2
> Reporter: Sergey Soldatov
> Assignee: Sergey Soldatov
> Priority: Major
>
> CodecBuffer.put(ToIntFunction) and CodecBuffer.putFromSource call
> buf.nioBuffer(index, length) every time they fill the buffer. Each call
> creates a new DirectByteBuffer object.
> Many hot paths fill a CodecBuffer this way: RocksDB get, iterator key and
> value reads, and string encoding. So OM operations that touch many entries,
> such as key listing, create several short-lived ByteBuffer objects per entry.
> This adds allocation and GC pressure on the OM.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]