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