Skip to content

Commit 0c76355

Browse files
authored
fix HardMaxCacheSize documentation (#298)
1 parent 74e2db1 commit 0c76355

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

config.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,13 @@ type Config struct {
2222
Verbose bool
2323
// Hasher used to map between string keys and unsigned 64bit integers, by default fnv64 hashing is used.
2424
Hasher Hasher
25-
// HardMaxCacheSize is a limit for cache size in MB. Cache will not allocate more memory than this limit.
25+
// HardMaxCacheSize is a limit for BytesQueue size in MB.
2626
// It can protect application from consuming all available memory on machine, therefore from running OOM Killer.
2727
// Default value is 0 which means unlimited size. When the limit is higher than 0 and reached then
28-
// the oldest entries are overridden for the new ones.
28+
// the oldest entries are overridden for the new ones. The max memory consumption will be bigger than
29+
// HardMaxCacheSize due to Shards' s additional memory. Every Shard consumes additional memory for map of keys
30+
// and statistics (map[uint64]uint32) the size of this map is equal to number of entries in
31+
// cache ~ 2×(64+32)×n bits + overhead or map itself.
2932
HardMaxCacheSize int
3033
// OnRemove is a callback fired when the oldest entry is removed because of its expiration time or no space left
3134
// for the new entry, or because delete was called.

0 commit comments

Comments
 (0)