Skip to content

Commit

Permalink
Set maximum size in case OOM
Browse files Browse the repository at this point in the history
  • Loading branch information
sswguo committed Dec 9, 2024
1 parent 130fbb1 commit 6c6d9e2
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,9 @@ public synchronized <K, V> Cache<K, V> getCache( String named )
private Cache buildCache()
{
Cache<String, String> cache = Caffeine.newBuilder()
.expireAfterAccess(15, TimeUnit.MINUTES)
.build();
.maximumSize( 50 )
.expireAfterAccess(15, TimeUnit.MINUTES)
.build();
return cache;
}

Expand Down

0 comments on commit 6c6d9e2

Please sign in to comment.