diff --git a/server/src/main/java/org/opensearch/indices/IndicesRequestCache.java b/server/src/main/java/org/opensearch/indices/IndicesRequestCache.java index 22a7573e135bf..42d7d973d09b8 100644 --- a/server/src/main/java/org/opensearch/indices/IndicesRequestCache.java +++ b/server/src/main/java/org/opensearch/indices/IndicesRequestCache.java @@ -106,6 +106,8 @@ public final class IndicesRequestCache implements RemovalListener registeredClosedListeners = ConcurrentCollections.newConcurrentMap(); private final Set keysToClean = ConcurrentCollections.newConcurrentSet(); private final ByteSizeValue size; @@ -265,8 +267,6 @@ interface CacheEntity extends Accountable, Writeable { * @opensearch.internal */ class Key implements Accountable, Writeable { - private final long BASE_RAM_BYTES_USED = RamUsageEstimator.shallowSizeOfInstance(Key.class); - public final CacheEntity entity; // use as identity equality public final String readerCacheKeyId; public final BytesReference value; diff --git a/server/src/main/java/org/opensearch/indices/IndicesService.java b/server/src/main/java/org/opensearch/indices/IndicesService.java index fd7635307a299..1605d639f2ffd 100644 --- a/server/src/main/java/org/opensearch/indices/IndicesService.java +++ b/server/src/main/java/org/opensearch/indices/IndicesService.java @@ -301,6 +301,8 @@ public class IndicesService extends AbstractLifecycleComponent Property.Final ); + private static long BASE_RAM_BYTES_USED = RamUsageEstimator.shallowSizeOfInstance(IndexShardCacheEntity.class); + /** * The node's settings. */ @@ -1757,7 +1759,6 @@ private BytesReference cacheShardLevelResult( * @opensearch.internal */ public final class IndexShardCacheEntity extends AbstractIndexShardCacheEntity { - private final long BASE_RAM_BYTES_USED = RamUsageEstimator.shallowSizeOfInstance(IndexShardCacheEntity.class); private final IndexShard indexShard; public IndexShardCacheEntity(IndexShard indexShard) {