symious commented on PR #1126:
URL: https://github.com/apache/ratis/pull/1126#issuecomment-2261803105
I tried to analyze the a local heap, but failed to reproduce the result
mentioned by @jojochuang .
```
Class Name
| Objects | Shallow Heap | Retained Heap
----------------------------------------------------------------------------------------------------------------------------
org.apache.logging.log4j.core.async.RingBufferLogEvent
| 262,144 | 27,262,976 | >= 41,943,032
org.apache.logging.log4j.core.async.AsyncLoggerConfigDisruptor$Log4jEventWrapper
| 262,144 | 6,291,456 | >= 6,291,456
org.apache.logging.log4j.core.time.MutableInstant
| 262,144 | 6,291,456 | >= 6,291,512
org.apache.logging.log4j.util.SortedArrayStringMap
| 262,143 | 8,388,576 | >= 8,389,096
byte[]
| 208,852 | 24,340,320 | >= 24,340,320
org.apache.ratis.proto.RaftProtos$CommitInfoProto
| 180,004 | 8,640,192 | >= 8,641,432
java.util.concurrent.ConcurrentHashMap$Node
| 161,219 | 5,159,008 | >= 41,160,136
java.util.concurrent.atomic.AtomicInteger
| 120,145 | 1,922,320 | >= 1,922,368
org.apache.ratis.thirdparty.com.google.protobuf.ByteString$LiteralByteString
| 120,023 | 2,880,552 | >= 15,601,672
org.apache.ratis.proto.RaftProtos$LogEntryProto
| 119,312 | 6,681,472 | >= 29,214,712
org.apache.ratis.server.protocol.TermIndex$1
| 119,311 | 3,817,952 | >= 3,818,040
org.apache.ratis.util.ReferenceCountedObject$3
| 119,311 | 3,817,952 | >= 34,942,304
org.apache.ratis.server.raftlog.LogEntryHeader$1
| 119,311 | 2,863,464 | >= 2,863,520
org.apache.ratis.server.raftlog.segmented.LogSegment$LogRecord
| 119,311 | 2,863,464 | >= 5,726,928
org.apache.ratis.thirdparty.com.google.common.cache.LocalCache$StrongValueReference|
118,544 | 1,896,704 | >= 34,296,768
java.lang.String
| 85,515 | 2,052,360 | >= 6,972,128
java.lang.Object[]
| 70,952 | 16,363,352 | >= 85,756,368
----------------------------------------------------------------------------------------------------------------------------
```
I think the following points are interesting:
1. The count of `TermIndex$1` and `RaftProtos$LogEntryProto` are similar
here, but quite different in @jojochuang 's case.
2. The count of `TermIndex$1` will be very large, so the default size of
Util.CACHE, which is 1 << 16, is not enough, so the cache hit rate should be
quite low.
Tested by running "ozone freon ommg --operation CREATE_FILE -n 30000 -t 1
--size=100 --bucket=bucket-1 --type RATIS --replication THREE" on master branch
of Ozone, heap analyzed from datanode.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]