Add some warning when offheap eviction occurs. - Fixes
@@ -105,6 +105,9 @@ public class IgniteCacheDatabaseSharedManager extends GridCacheSharedManagerAdap
/** Page size from memory configuration, may be set only for fake(standalone) IgniteCacheDataBaseSharedManager */
private int pageSize;
+ /** First eviction flag. */
+ private volatile boolean firstEvictWarn;
+
/** {@inheritDoc} */
@Override protected void start0() throws IgniteCheckedException {
if (cctx.kernalContext().clientNode() && cctx.kernalContext().config().getDataStorageConfiguration() == null)
@@ -857,6 +860,8 @@ public class IgniteCacheDatabaseSharedManager extends GridCacheSharedManagerAdap
emptyDataPagesCnt < plcCfg.getEmptyPagesPoolSize();
if (shouldEvict) {
+ warnFirstEvict(plcCfg);
+
memPlc.evictionTracker().evictDataPage();
memPlc.memoryMetrics().updateEvictionRate();
@@ -1083,4 +1088,23 @@ public class IgniteCacheDatabaseSharedManager extends GridCacheSharedManagerAdap
public void walEnabled(int grpId, boolean enabled, boolean local) {
// No-op.
}
+
+ /**
+ * Warns on first eviction.
+ */
+ private void warnFirstEvict(DataRegionConfiguration plcCfg) {
+ if (firstEvictWarn)
+ return;
+
+ // Do not move warning output to synchronized block (it causes warning in IDE).
+ synchronized (this) {
+ if (firstEvictWarn)
+ return;
+
+ firstEvictWarn = true;
+ }
+
+ U.warn(log, "Page-based evictions started." +
+ " You may wish to increase 'maxSize' on page memory policy: " + plcCfg.getName());
+ }
}
