benwtrent commented on code in PR #14765: URL: https://github.com/apache/lucene/pull/14765#discussion_r2138150901
########## lucene/core/src/java/org/apache/lucene/util/hnsw/OnHeapHnswGraph.java: ########## @@ -158,21 +168,30 @@ public void addNode(int level, int node) { size.incrementAndGet(); } if (level == 0) { - graph[node][level] = new NeighborArray(nsize0, true); + graph[node][level] = + new NeighborArray( + nsize0, + true, + l -> { + long bytesUsed = graphRamBytesUsed; + graphRamBytesUsed = bytesUsed + l; + assert l > 0; Review Comment: ++ Yep! I will simplify, I was testing somethings out and left the other assert :/ -- 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