benwtrent commented on PR #14527: URL: https://github.com/apache/lucene/pull/14527#issuecomment-2854224239
> I use the maxSize variable to ensure that the elementsCount of the array cannot exceed the maxSize value. The underlying structures utilize `ArrayUtil.grow` to ensure capacity. This means its very easy to overshoot the maximum size. This is why I was saying we should use a new structure directly restricts the underlying buffers. > I updated the ramBytesUsed method, the memory is correct now. I do not like this solution. Relying on the external builders to adjust estimates seems trappy. Allowing neighborarrays to update via a callback seems way nicer. -- 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