From 38e2c151ec6c6c28a554b7d70c9af60ea0378a14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E7=A5=A5=E8=B6=85?= Date: Fri, 3 Dec 2021 10:22:03 +0800 Subject: [PATCH] =?UTF-8?q?=E9=99=8D=E4=BD=8Ettlcache=E6=9C=80=E5=A4=A7?= =?UTF-8?q?=E5=86=85=E5=AD=98=E5=A2=9E=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/ttlcache/cache.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/ttlcache/cache.go b/internal/ttlcache/cache.go index d1e1f77..668a52d 100644 --- a/internal/ttlcache/cache.go +++ b/internal/ttlcache/cache.go @@ -8,8 +8,8 @@ import ( // Cache TTL缓存 // 最大的缓存时间为30 * 86400 // Piece数据结构: -// Piece1 | Piece2 | Piece3 | ... -// [ Item1, Item2, ... | ... +// Piece1 | Piece2 | Piece3 | ... +// [ Item1, Item2, ... ] | ... // KeyMap列表数据结构 // { timestamp1 => [key1, key2, ...] }, ... type Cache struct { @@ -26,7 +26,7 @@ func NewCache(opt ...OptionInterface) *Cache { countPieces := 128 maxItems := 2_000_000 - var delta = systemMemoryGB() / 4 + var delta = systemMemoryGB() / 8 if delta > 0 { maxItems *= delta }