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


##########
lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene90/Lucene90HnswVectorsReader.java:
##########
@@ -306,6 +306,16 @@ private HnswGraph getGraphValues(FieldEntry entry) throws 
IOException {
     return new OffHeapHnswGraph(entry, bytesSlice);
   }
 
+  @Override
+  public long offHeapBytes() {
+    long bytes = 0L;
+    for (var field : fields.values()) {
+      var f = field.value;
+      bytes += f.vectorDataLength() + f.indexDataLength();
+    }
+    return bytes;

Review Comment:
   That a good point, and one that I did think off too, but I wasn't able to 
come up with something simple as all these fields are their own individual 
inner classes, and any refactoring I experimented with just seemed to add 
complexity. :-( 



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to