File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
server/src/main/java/org/elasticsearch/indices Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments