mikemccand commented on code in PR #15982:
URL: https://github.com/apache/lucene/pull/15982#discussion_r3173802121


##########
lucene/core/src/java/org/apache/lucene/codecs/BufferingKnnVectorsWriter.java:
##########
@@ -260,7 +260,7 @@ public final long ramBytesUsed() {
               * (long)
                   (RamUsageEstimator.NUM_BYTES_OBJECT_REF
                       + RamUsageEstimator.NUM_BYTES_ARRAY_HEADER)
-          + vectors.size() * (long) dim * Float.BYTES;
+          + vectors.size() * (long) dim * 
fieldInfo.getVectorEncoding().byteSize;

Review Comment:
   Whoa, so this means, if Lucene user was index vectors coming in as `byte[]` 
(like they pre-quantize, outside of Lucene), we were incorrectly counting them 
as 4X larger RAM usage, and IW would flush way too early?



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