benwtrent commented on code in PR #15124: URL: https://github.com/apache/lucene/pull/15124#discussion_r2361216439
########## lucene/core/src/java/org/apache/lucene/search/LRUQueryCache.java: ########## @@ -426,10 +425,8 @@ public void clear() { } private static long getRamBytesUsed(Query query) { - return LINKED_HASHTABLE_RAM_BYTES_PER_ENTRY - + (query instanceof Accountable accountableQuery - ? accountableQuery.ramBytesUsed() - : QUERY_DEFAULT_RAM_BYTES_USED); + long queryRamBytesUsed = RamUsageEstimator.sizeOf(query, 0); + return LINKED_HASHTABLE_RAM_BYTES_PER_ENTRY + queryRamBytesUsed; Review Comment: so great! I really like this. -- 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