Skip to content

Commit e29dd3a

Browse files
committed
adding wording to a comment
1 parent bc56cf8 commit e29dd3a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

server/src/main/java/org/elasticsearch/indices/IndicesQueryCache.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,13 @@ private long getShareOfAdditionalRamBytesUsed(long itemsInCacheForShard) {
129129
additionalRamBytesUsed = Math.round((double) sharedRamBytesUsed / shardCount);
130130
} else {
131131
/*
132-
* some shards have nonzero cache footprint, so we apportion the size of the shared bytes proportionally to the number of
132+
* Some shards have nonzero cache footprint, so we apportion the size of the shared bytes proportionally to the number of
133133
* segment-requests in the cache for this shard (the number and size of documents associated with those requests is irrelevant
134134
* for this calculation).
135+
* Note that this was a somewhat arbitrary decision. Calculating it by number of documents might have been better. Calculating
136+
* it by number of documents weighted by size would also be good, but possibly more expensive. But the decision to attribute
137+
* memory proportionally to the number of segment-requests was made a long time ago, and we're sticking with that here for the
138+
* sake of consistency and backwards compatibility.
135139
*/
136140
additionalRamBytesUsed = Math.round((double) sharedRamBytesUsed * itemsInCacheForShard / totalItemsInCache);
137141
}

0 commit comments

Comments
 (0)