ChrisHegarty commented on code in PR #14426:
URL: https://github.com/apache/lucene/pull/14426#discussion_r2022995174


##########
lucene/core/src/java/org/apache/lucene/codecs/lucene102/Lucene102BinaryQuantizedVectorsReader.java:
##########
@@ -257,6 +257,15 @@ public long ramBytesUsed() {
     return size;
   }
 
+  @Override
+  public long offHeapBytes() {
+    long bytes = 0L;
+    for (var field : fields.values()) {
+      bytes += field.vectorDataLength();
+    }
+    return bytes;
+  }
+

Review Comment:
   I don't deny that this is not ideal, but it not a new model, it already 
exists - `Accountable`.  One should always consider whether or not children 
should be counted, and if so how. 



##########
lucene/core/src/java/org/apache/lucene/codecs/lucene102/Lucene102BinaryQuantizedVectorsReader.java:
##########
@@ -257,6 +257,15 @@ public long ramBytesUsed() {
     return size;
   }
 
+  @Override
+  public long offHeapBytes() {
+    long bytes = 0L;
+    for (var field : fields.values()) {
+      bytes += field.vectorDataLength();
+    }
+    return bytes;
+  }
+

Review Comment:
   I don't deny that this is not ideal, but it's not a new model, it already 
exists - `Accountable`.  One should always consider whether or not children 
should be counted, and if so how. 



-- 
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: issues-unsubscr...@lucene.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to