benwtrent commented on code in PR #15597:
URL: https://github.com/apache/lucene/pull/15597#discussion_r2712375638


##########
lucene/core/src/java/org/apache/lucene/util/hnsw/NeighborArray.java:
##########
@@ -53,11 +52,11 @@ public NeighborArray(int maxSize, boolean descOrder, 
LongConsumer onHeapMemoryUs
     this.maxSize = maxSize;
     nodes = new MaxSizedIntArrayList(maxSize, maxSize / 8);
     scores = new MaxSizedFloatArrayList(maxSize, maxSize / 8);
-    this.ramBytesUsed += nodes.ramBytesUsed() + scores.ramBytesUsed();

Review Comment:
   Yeah, this one is a silly left over. IIRC, it was because the individual was 
attempting to keep track of memory per individual neighbor array, but doing it 
naively, rebuilding the ram bytes on every call. So decided to cache it. 
   
   Then we moved to the LongConsumer model which provides a nicer interface for 
graph usage and never moved this unnecessary `long` value.



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