Skip to content

Commit 6c6d9e2

Browse files
committed
Set maximum size in case OOM
1 parent 130fbb1 commit 6c6d9e2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/main/java/org/commonjava/indy/service/httprox/util/CacheProducer.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,9 @@ public synchronized <K, V> Cache<K, V> getCache( String named )
4444
private Cache buildCache()
4545
{
4646
Cache<String, String> cache = Caffeine.newBuilder()
47-
.expireAfterAccess(15, TimeUnit.MINUTES)
48-
.build();
47+
.maximumSize( 50 )
48+
.expireAfterAccess(15, TimeUnit.MINUTES)
49+
.build();
4950
return cache;
5051
}
5152

0 commit comments

Comments
 (0)