private void cleanCacheIfNecessary() {
    final long timeMs = System.currentTimeMillis();
    if (mySharedMemCache.size() < 2)
      return;

    ArrayList<String> toRemove = new ArrayList<>();
    for (Map.Entry<String, SharedMemory.WithRaster> item: mySharedMemCache.entrySet()) {
      if (timeMs - item.getValue().lasUsedMs > CLEAN_CACHE_TIME_MS) {
        toRemove.add(item.getKey());
      }
    }
    for (String name: toRemove) {
      mySharedMemCache.remove(name);
    }
  }
private void cleanCacheIfNecessary()