You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by "JackieTien97 (via GitHub)" <gi...@apache.org> on 2023/07/18 07:09:51 UTC
[GitHub] [iotdb] JackieTien97 commented on a diff in pull request #10543: [IOTDB-6065] Considering LastCacheContainer in the memory estimation of SchemaCacheEntry
JackieTien97 commented on code in PR #10543:
URL: https://github.com/apache/iotdb/pull/10543#discussion_r1266307545
##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/cache/schema/lastcache/LastCacheContainer.java:
##########
@@ -58,13 +58,22 @@ public synchronized void updateCachedLast(
}
}
+ /**
+ * Total basic 100B
+ *
+ * <ul>
+ * <li>LastCacheContainer Object header, 8B
+ * <li>ILastCacheValue reference, 8B
+ * <li>ILastCacheValue
+ * <ul>
+ * <li>long timestamp 8B
+ * <li>Object TsPrimitiveType reference, 8B
+ * <li>Object TsPrimitiveType value;
+ * </ul>
+ * </ul>
+ */
@Override
- public synchronized void resetLastCache() {
- lastCacheValue = null;
- }
-
- @Override
- public boolean isEmpty() {
- return lastCacheValue == null;
+ public int estimateSize() {
+ return 16 + (lastCacheValue == null ? 0 : 16 + lastCacheValue.getValue().getSize());
Review Comment:
`lastCacheValue.getValue()` may return null
--
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: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org