MCPcopy Create free account
hub / github.com/couchbase/sync_gateway / performEviction

Method performEviction

db/revision_cache_lru.go:891–894  ·  view source on GitHub ↗

performEviction will evict the oldest items in the cache till we are below the memory threshold

(ctx context.Context)

Source from the content-addressed store, hash-verified

889
890// performEviction will evict the oldest items in the cache till we are below the memory threshold
891func (rc *LRURevisionCache) performEviction(ctx context.Context) {
892 numItemsRemoved := rc.evictBasedOffMemoryUsage(ctx)
893 rc.cacheNumItems.Add(-numItemsRemoved)
894}
895
896func (rc *LRURevisionCache) evictBasedOffMemoryUsage(ctx context.Context) int64 {
897 var numItemsRemoved, numBytesRemoved int64

Callers 1

Calls 2

AddMethod · 0.45

Tested by

no test coverage detected