use weak references for lock keys

This commit is contained in:
Athou
2013-05-27 11:37:38 +02:00
parent ab88a2f892
commit 475391c6a7

View File

@@ -66,7 +66,7 @@ public class FeedRefreshUpdater {
ApplicationSettings settings = applicationSettingsService.get();
int threads = Math.max(settings.getDatabaseUpdateThreads(), 1);
log.info("Creating database pool with {} threads", threads);
locks = Striped.lock(threads);
locks = Striped.lazyWeakLock(threads);
pool = new ThreadPoolExecutor(threads, threads, 0,
TimeUnit.MILLISECONDS,
queue = new ArrayBlockingQueue<Runnable>(100 * threads));