You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sb...@apache.org on 2017/04/28 12:40:12 UTC

[3/9] ignite git commit: IGNITE-5072 - Updated memory metrics to comply with other metrics

http://git-wip-us.apache.org/repos/asf/ignite/blob/11c23b62/modules/core/src/test/java/org/apache/ignite/internal/processors/database/BPlusTreeSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/BPlusTreeSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/BPlusTreeSelfTest.java
index 32c6675..0254c4c 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/BPlusTreeSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/BPlusTreeSelfTest.java
@@ -31,6 +31,7 @@ import java.util.concurrent.atomic.AtomicLong;
 import java.util.concurrent.atomic.AtomicLongArray;
 import java.util.concurrent.locks.Lock;
 import org.apache.ignite.IgniteCheckedException;
+import org.apache.ignite.configuration.MemoryPolicyConfiguration;
 import org.apache.ignite.internal.IgniteInternalFuture;
 import org.apache.ignite.internal.mem.unsafe.UnsafeMemoryProvider;
 import org.apache.ignite.internal.pagemem.FullPageId;
@@ -629,7 +630,7 @@ public class BPlusTreeSelfTest extends GridCommonAbstractTest {
 
         Map<Long,Long> map = new HashMap<>();
 
-        int loops = reuseList == null ? 100_000 : 300_000;
+        int loops = reuseList == null ? 20_000 : 60_000;
 
         for (int i = 0 ; i < loops; i++) {
             final Long x = (long)BPlusTree.randomInt(CNT);
@@ -1232,7 +1233,7 @@ public class BPlusTreeSelfTest extends GridCommonAbstractTest {
 
         final Map<Long,Long> map = new ConcurrentHashMap8<>();
 
-        final int loops = reuseList == null ? 100_000 : 200_000;
+        final int loops = reuseList == null ? 20_000 : 60_000;
 
         final GridStripedLock lock = new GridStripedLock(256);
 
@@ -1272,7 +1273,7 @@ public class BPlusTreeSelfTest extends GridCommonAbstractTest {
                             tree.invoke(x, null, new IgniteTree.InvokeClosure<Long>() {
                                 IgniteTree.OperationType opType;
 
-                                @Override public void call(@Nullable Long row) throws IgniteCheckedException {
+                                @Override public void call(@Nullable Long row) {
                                     opType = PUT;
 
                                     if (row != null)
@@ -1294,7 +1295,7 @@ public class BPlusTreeSelfTest extends GridCommonAbstractTest {
                             tree.invoke(x, null, new IgniteTree.InvokeClosure<Long>() {
                                 IgniteTree.OperationType opType;
 
-                                @Override public void call(@Nullable Long row) throws IgniteCheckedException {
+                                @Override public void call(@Nullable Long row) {
                                     if (row != null) {
                                         assertEquals(x, row);
                                         opType = REMOVE;
@@ -1685,8 +1686,7 @@ public class BPlusTreeSelfTest extends GridCommonAbstractTest {
         }
 
         /** {@inheritDoc} */
-        @Override public Long getLookupRow(BPlusTree<Long,?> tree, long pageAddr, int idx)
-            throws IgniteCheckedException {
+        @Override public Long getLookupRow(BPlusTree<Long,?> tree, long pageAddr, int idx) {
             Long row = PageUtils.getLong(pageAddr, offset(idx));
 
             checkNotRemoved(row);
@@ -1699,17 +1699,14 @@ public class BPlusTreeSelfTest extends GridCommonAbstractTest {
      * @return Page memory.
      */
     protected PageMemory createPageMemory() throws Exception {
-        long[] sizes = new long[CPUS];
-
-        for (int i = 0; i < sizes.length; i++)
-            sizes[i] = 1024 * MB / CPUS;
+        MemoryPolicyConfiguration plcCfg = new MemoryPolicyConfiguration().setMaxSize(1024 * MB);
 
         PageMemory pageMem = new PageMemoryNoStoreImpl(log,
-            new UnsafeMemoryProvider(sizes),
+            new UnsafeMemoryProvider(log),
             null,
             PAGE_SIZE,
-            null,
-            new MemoryMetricsImpl(null), true);
+            plcCfg,
+            new MemoryMetricsImpl(plcCfg), true);
 
         pageMem.start();
 
@@ -1754,8 +1751,7 @@ public class BPlusTreeSelfTest extends GridCommonAbstractTest {
         }
 
         /** {@inheritDoc} */
-        @Override public Long getLookupRow(BPlusTree<Long,?> tree, long pageAddr, int idx)
-            throws IgniteCheckedException {
+        @Override public Long getLookupRow(BPlusTree<Long,?> tree, long pageAddr, int idx) {
             return PageUtils.getLong(pageAddr, offset(idx));
         }
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/11c23b62/modules/core/src/test/java/org/apache/ignite/internal/processors/database/FreeListImplSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/FreeListImplSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/FreeListImplSelfTest.java
index 1cede9b..5f61bd6 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/FreeListImplSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/FreeListImplSelfTest.java
@@ -29,6 +29,7 @@ import java.util.concurrent.ConcurrentMap;
 import java.util.concurrent.ThreadLocalRandom;
 import java.util.concurrent.atomic.AtomicBoolean;
 import org.apache.ignite.IgniteCheckedException;
+import org.apache.ignite.configuration.MemoryPolicyConfiguration;
 import org.apache.ignite.internal.mem.unsafe.UnsafeMemoryProvider;
 import org.apache.ignite.internal.pagemem.PageIdAllocator;
 import org.apache.ignite.internal.pagemem.PageMemory;
@@ -145,7 +146,7 @@ public class FreeListImplSelfTest extends GridCommonAbstractTest {
 
     /**
      * @param pageSize Page size.
-     * @throws Exception
+     * @throws Exception If failed.
      */
     protected void checkInsertDeleteMultiThreaded(final int pageSize) throws Exception {
         final FreeList list = createFreeList(pageSize);
@@ -175,7 +176,7 @@ public class FreeListImplSelfTest extends GridCommonAbstractTest {
             @Override public Object call() throws Exception {
                 Random rnd = ThreadLocalRandom.current();
 
-                for (int i = 0; i < 1_000_000; i++) {
+                for (int i = 0; i < 200_000; i++) {
                     boolean grow0 = grow.get();
 
                     if (grow0) {
@@ -313,18 +314,13 @@ public class FreeListImplSelfTest extends GridCommonAbstractTest {
     /**
      * @return Page memory.
      */
-    protected PageMemory createPageMemory(int pageSize) throws Exception {
-        long[] sizes = new long[CPUS];
-
-        for (int i = 0; i < sizes.length; i++)
-            sizes[i] = 1024 * MB / CPUS;
-
+    protected PageMemory createPageMemory(int pageSize, MemoryPolicyConfiguration plcCfg) throws Exception {
         PageMemory pageMem = new PageMemoryNoStoreImpl(log,
-            new UnsafeMemoryProvider(sizes),
+            new UnsafeMemoryProvider(log),
             null,
             pageSize,
-            null,
-            new MemoryMetricsImpl(null),
+            plcCfg,
+            new MemoryMetricsImpl(plcCfg),
             true);
 
         pageMem.start();
@@ -338,13 +334,15 @@ public class FreeListImplSelfTest extends GridCommonAbstractTest {
      * @throws Exception If failed.
      */
     protected FreeList createFreeList(int pageSize) throws Exception {
-        pageMem = createPageMemory(pageSize);
+        MemoryPolicyConfiguration plcCfg = new MemoryPolicyConfiguration().setMaxSize(1024 * MB);
+
+        pageMem = createPageMemory(pageSize, plcCfg);
 
         long metaPageId = pageMem.allocatePage(1, 1, PageIdAllocator.FLAG_DATA);
 
-        MemoryMetricsImpl metrics = new MemoryMetricsImpl(null);
+        MemoryMetricsImpl metrics = new MemoryMetricsImpl(plcCfg);
 
-        MemoryPolicy memPlc = new MemoryPolicy(pageMem, null, metrics, new NoOpPageEvictionTracker());
+        MemoryPolicy memPlc = new MemoryPolicy(pageMem, plcCfg, metrics, new NoOpPageEvictionTracker());
 
         return new FreeListImpl(1, "freelist", metrics, memPlc, null, null, metaPageId, true);
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/11c23b62/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbDynamicCacheSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbDynamicCacheSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbDynamicCacheSelfTest.java
index a2732e8..3b3e1de 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbDynamicCacheSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbDynamicCacheSelfTest.java
@@ -44,7 +44,7 @@ public class IgniteDbDynamicCacheSelfTest extends GridCommonAbstractTest {
         MemoryPolicyConfiguration plc = new MemoryPolicyConfiguration();
 
         plc.setName("dfltPlc");
-        plc.setSize(200 * 1024 * 1024);
+        plc.setMaxSize(200 * 1024 * 1024);
 
         dbCfg.setDefaultMemoryPolicyName("dfltPlc");
         dbCfg.setMemoryPolicies(plc);

http://git-wip-us.apache.org/repos/asf/ignite/blob/11c23b62/modules/core/src/test/java/org/apache/ignite/internal/processors/database/MemoryMetricsSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/MemoryMetricsSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/MemoryMetricsSelfTest.java
index 5347a23..cb5700f 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/MemoryMetricsSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/MemoryMetricsSelfTest.java
@@ -18,6 +18,7 @@ package org.apache.ignite.internal.processors.database;
 
 import java.util.concurrent.CountDownLatch;
 import org.apache.ignite.MemoryMetrics;
+import org.apache.ignite.configuration.MemoryPolicyConfiguration;
 import org.apache.ignite.internal.processors.cache.database.MemoryMetricsImpl;
 import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
 
@@ -41,7 +42,9 @@ public class MemoryMetricsSelfTest extends GridCommonAbstractTest {
 
     /** {@inheritDoc} */
     @Override protected void beforeTest() throws Exception {
-        memMetrics = new MemoryMetricsImpl(null);
+        MemoryPolicyConfiguration plcCfg = new MemoryPolicyConfiguration();
+
+        memMetrics = new MemoryMetricsImpl(plcCfg);
 
         memMetrics.enableMetrics();
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/11c23b62/modules/core/src/test/java/org/apache/ignite/internal/processors/database/MetadataStorageSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/MetadataStorageSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/MetadataStorageSelfTest.java
index 61c8ad9..af0b849 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/MetadataStorageSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/MetadataStorageSelfTest.java
@@ -17,6 +17,7 @@
 
 package org.apache.ignite.internal.processors.database;
 
+import org.apache.ignite.configuration.MemoryPolicyConfiguration;
 import org.apache.ignite.internal.mem.DirectMemoryProvider;
 import org.apache.ignite.internal.pagemem.FullPageId;
 import org.apache.ignite.internal.pagemem.PageIdAllocator;
@@ -154,13 +155,17 @@ public class MetadataStorageSelfTest extends GridCommonAbstractTest {
      * @return Page memory instance.
      */
     protected PageMemory memory(boolean clean) throws Exception {
-        long[] sizes = new long[10];
-
-        for (int i = 0; i < sizes.length; i++)
-            sizes[i] = 1024 * 1024;
-
-        DirectMemoryProvider provider = new MappedFileMemoryProvider(log(), allocationPath, clean, sizes);
-
-        return new PageMemoryNoStoreImpl(log, provider, null, PAGE_SIZE, null, new MemoryMetricsImpl(null), true);
+        DirectMemoryProvider provider = new MappedFileMemoryProvider(log(), allocationPath);
+
+        MemoryPolicyConfiguration plcCfg = new MemoryPolicyConfiguration().setMaxSize(30 * 1024 * 1024);
+
+        return new PageMemoryNoStoreImpl(
+            log,
+            provider,
+            null,
+            PAGE_SIZE,
+            plcCfg,
+            new MemoryMetricsImpl(plcCfg),
+            true);
     }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/11c23b62/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsSizeSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsSizeSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsSizeSelfTest.java
index fbe0872..456971a 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsSizeSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsSizeSelfTest.java
@@ -397,7 +397,7 @@ public class IgfsSizeSelfTest extends IgfsCommonAbstractTest {
                 String memPlcName = "igfsDataMemPlc";
 
                 cfg.setMemoryConfiguration(new MemoryConfiguration().setMemoryPolicies(
-                    new MemoryPolicyConfiguration().setSize(maxSize).setName(memPlcName)));
+                    new MemoryPolicyConfiguration().setMaxSize(maxSize).setName(memPlcName)));
 
                 FileSystemConfiguration igfsCfg = cfg.getFileSystemConfiguration()[0];
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/11c23b62/modules/core/src/test/java/org/apache/ignite/platform/PlatformCacheWriteMetricsTask.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/platform/PlatformCacheWriteMetricsTask.java b/modules/core/src/test/java/org/apache/ignite/platform/PlatformCacheWriteMetricsTask.java
index da013bd..b99424d 100644
--- a/modules/core/src/test/java/org/apache/ignite/platform/PlatformCacheWriteMetricsTask.java
+++ b/modules/core/src/test/java/org/apache/ignite/platform/PlatformCacheWriteMetricsTask.java
@@ -235,11 +235,6 @@ public class PlatformCacheWriteMetricsTask extends ComputeTaskAdapter<Long, Obje
         }
 
         /** {@inheritDoc} */
-        @Override public long getOffHeapMaxSize() {
-            return 28;
-        }
-
-        /** {@inheritDoc} */
         @Override public int getSize() {
             return 29;
         }

http://git-wip-us.apache.org/repos/asf/ignite/blob/11c23b62/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheDistributedPartitionQueryAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheDistributedPartitionQueryAbstractSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheDistributedPartitionQueryAbstractSelfTest.java
index 708fb1d..0a0afb4 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheDistributedPartitionQueryAbstractSelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheDistributedPartitionQueryAbstractSelfTest.java
@@ -45,7 +45,6 @@ import org.apache.ignite.cluster.ClusterNode;
 import org.apache.ignite.configuration.CacheConfiguration;
 import org.apache.ignite.configuration.IgniteConfiguration;
 import org.apache.ignite.configuration.MemoryConfiguration;
-import org.apache.ignite.configuration.MemoryPolicyConfiguration;
 import org.apache.ignite.internal.IgniteInterruptedCheckedException;
 import org.apache.ignite.internal.util.GridRandom;
 import org.apache.ignite.internal.util.typedef.F;
@@ -137,9 +136,7 @@ public abstract class IgniteCacheDistributedPartitionQueryAbstractSelfTest exten
     @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
         IgniteConfiguration cfg = super.getConfiguration(gridName);
 
-        MemoryConfiguration memCfg = new MemoryConfiguration();
-        memCfg.setDefaultMemoryPolicyName("default");
-        memCfg.setMemoryPolicies(new MemoryPolicyConfiguration().setName("default").setSize(20 * 1024 * 1024));
+        MemoryConfiguration memCfg = new MemoryConfiguration().setDefaultMemoryPolicySize(20 * 1024 * 1024);
 
         cfg.setMemoryConfiguration(memCfg);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/11c23b62/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryNodeRestartSelfTest2.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryNodeRestartSelfTest2.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryNodeRestartSelfTest2.java
index 001f40b..943a5c8 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryNodeRestartSelfTest2.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryNodeRestartSelfTest2.java
@@ -29,16 +29,15 @@ import org.apache.ignite.IgniteCache;
 import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.cache.affinity.AffinityKey;
 import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction;
+import org.apache.ignite.cache.query.QueryCancelledException;
 import org.apache.ignite.cache.query.SqlFieldsQuery;
 import org.apache.ignite.cache.query.annotations.QuerySqlField;
 import org.apache.ignite.configuration.CacheConfiguration;
 import org.apache.ignite.configuration.IgniteConfiguration;
 import org.apache.ignite.configuration.MemoryConfiguration;
-import org.apache.ignite.configuration.MemoryPolicyConfiguration;
 import org.apache.ignite.internal.IgniteFutureTimeoutCheckedException;
 import org.apache.ignite.internal.IgniteInternalFuture;
 import org.apache.ignite.internal.IgniteInterruptedCheckedException;
-import org.apache.ignite.cache.query.QueryCancelledException;
 import org.apache.ignite.internal.util.GridRandom;
 import org.apache.ignite.internal.util.typedef.CAX;
 import org.apache.ignite.internal.util.typedef.F;
@@ -91,9 +90,7 @@ public class IgniteCacheQueryNodeRestartSelfTest2 extends GridCommonAbstractTest
     @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
         IgniteConfiguration c = super.getConfiguration(igniteInstanceName);
 
-        MemoryConfiguration memCfg = new MemoryConfiguration();
-        memCfg.setDefaultMemoryPolicyName("default");
-        memCfg.setMemoryPolicies(new MemoryPolicyConfiguration().setName("default").setSize(50 * 1024 * 1024));
+        MemoryConfiguration memCfg = new MemoryConfiguration().setDefaultMemoryPolicySize(50 * 1024 * 1024);
 
         c.setMemoryConfiguration(memCfg);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/11c23b62/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/DynamicIndexAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/DynamicIndexAbstractSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/DynamicIndexAbstractSelfTest.java
index 3db3050..fc765a4 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/DynamicIndexAbstractSelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/DynamicIndexAbstractSelfTest.java
@@ -138,7 +138,11 @@ public abstract class DynamicIndexAbstractSelfTest extends AbstractSchemaSelfTes
 
         MemoryConfiguration memCfg = new MemoryConfiguration()
             .setDefaultMemoryPolicyName("default")
-            .setMemoryPolicies(new MemoryPolicyConfiguration().setName("default").setSize(32 * 1024 * 1024L)
+            .setMemoryPolicies(
+                new MemoryPolicyConfiguration()
+                    .setName("default")
+                    .setMaxSize(32 * 1024 * 1024L)
+                    .setInitialSize(32 * 1024 * 1024L)
         );
 
         cfg.setMemoryConfiguration(memCfg);

http://git-wip-us.apache.org/repos/asf/ignite/blob/11c23b62/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/database/InlineIndexHelperTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/database/InlineIndexHelperTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/database/InlineIndexHelperTest.java
index 0317672..c101d04 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/database/InlineIndexHelperTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/database/InlineIndexHelperTest.java
@@ -24,6 +24,7 @@ import java.util.Arrays;
 import java.util.UUID;
 import junit.framework.TestCase;
 import org.apache.commons.io.Charsets;
+import org.apache.ignite.configuration.MemoryPolicyConfiguration;
 import org.apache.ignite.internal.mem.unsafe.UnsafeMemoryProvider;
 import org.apache.ignite.internal.pagemem.PageIdAllocator;
 import org.apache.ignite.internal.pagemem.PageMemory;
@@ -130,17 +131,16 @@ public class InlineIndexHelperTest extends TestCase {
 
     /** */
     public void testStringTruncate() throws Exception {
-        long[] sizes = new long[CPUS];
+        MemoryPolicyConfiguration plcCfg = new MemoryPolicyConfiguration().setMaxSize(1024 * MB);
 
-        for (int i = 0; i < sizes.length; i++)
-            sizes[i] = 1024 * MB / CPUS;
+        JavaLogger log = new JavaLogger();
 
-        PageMemory pageMem = new PageMemoryNoStoreImpl(new JavaLogger(),
-            new UnsafeMemoryProvider(sizes),
+        PageMemory pageMem = new PageMemoryNoStoreImpl(log,
+            new UnsafeMemoryProvider(log),
             null,
             PAGE_SIZE,
-            null,
-            new MemoryMetricsImpl(null),
+            plcCfg,
+            new MemoryMetricsImpl(plcCfg),
             false);
 
         pageMem.start();
@@ -177,17 +177,16 @@ public class InlineIndexHelperTest extends TestCase {
 
     /** */
     public void testBytes() throws Exception {
-        long[] sizes = new long[CPUS];
+        MemoryPolicyConfiguration plcCfg = new MemoryPolicyConfiguration().setMaxSize(1024 * MB);
 
-        for (int i = 0; i < sizes.length; i++)
-            sizes[i] = 1024 * MB / CPUS;
+        JavaLogger log = new JavaLogger();
 
-        PageMemory pageMem = new PageMemoryNoStoreImpl(new JavaLogger(),
-            new UnsafeMemoryProvider(sizes),
+        PageMemory pageMem = new PageMemoryNoStoreImpl(log,
+            new UnsafeMemoryProvider(log),
             null,
             PAGE_SIZE,
-            null,
-            new MemoryMetricsImpl(null),
+            plcCfg,
+            new MemoryMetricsImpl(plcCfg),
             false);
 
         pageMem.start();
@@ -293,17 +292,16 @@ public class InlineIndexHelperTest extends TestCase {
 
     /** */
     private void testPutGet(Value v1, Value v2, Value v3) throws Exception {
-        long[] sizes = new long[CPUS];
+        MemoryPolicyConfiguration plcCfg = new MemoryPolicyConfiguration().setMaxSize(1024 * MB);
 
-        for (int i = 0; i < sizes.length; i++)
-            sizes[i] = 1024 * MB / CPUS;
+        JavaLogger log = new JavaLogger();
 
-        PageMemory pageMem = new PageMemoryNoStoreImpl(new JavaLogger(),
-            new UnsafeMemoryProvider(sizes),
+        PageMemory pageMem = new PageMemoryNoStoreImpl(log,
+            new UnsafeMemoryProvider(log),
             null,
             PAGE_SIZE,
-            null,
-            new MemoryMetricsImpl(null),
+            plcCfg,
+            new MemoryMetricsImpl(plcCfg),
             false);
 
         pageMem.start();

http://git-wip-us.apache.org/repos/asf/ignite/blob/11c23b62/modules/platforms/cpp/core-test/config/cache-identity-32.xml
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core-test/config/cache-identity-32.xml b/modules/platforms/cpp/core-test/config/cache-identity-32.xml
index 4a8a68f..1d43678 100644
--- a/modules/platforms/cpp/core-test/config/cache-identity-32.xml
+++ b/modules/platforms/cpp/core-test/config/cache-identity-32.xml
@@ -33,14 +33,17 @@
     <bean parent="grid.cfg">
         <property name="memoryConfiguration">
             <bean class="org.apache.ignite.configuration.MemoryConfiguration">
-                <property name="systemCacheMemorySize" value="#{40 * 1024 * 1024}"/>
+                <property name="systemCacheInitialSize" value="#{40 * 1024 * 1024}"/>
+                <property name="systemCacheMaxSize" value="#{40 * 1024 * 1024}"/>
+
                 <property name="defaultMemoryPolicyName" value="dfltPlc"/>
 
                 <property name="memoryPolicies">
                     <list>
                         <bean class="org.apache.ignite.configuration.MemoryPolicyConfiguration">
                             <property name="name" value="dfltPlc"/>
-                            <property name="size" value="#{100 * 1024 * 1024}"/>
+                            <property name="maxSize" value="#{100 * 1024 * 1024}"/>
+                            <property name="initialSize" value="#{100 * 1024 * 1024}"/>
                         </bean>
                     </list>
                 </property>

http://git-wip-us.apache.org/repos/asf/ignite/blob/11c23b62/modules/platforms/cpp/core-test/config/cache-query-32.xml
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core-test/config/cache-query-32.xml b/modules/platforms/cpp/core-test/config/cache-query-32.xml
index 6927705..ddbd690 100644
--- a/modules/platforms/cpp/core-test/config/cache-query-32.xml
+++ b/modules/platforms/cpp/core-test/config/cache-query-32.xml
@@ -33,14 +33,16 @@
     <bean parent="grid.cfg">
         <property name="memoryConfiguration">
             <bean class="org.apache.ignite.configuration.MemoryConfiguration">
-                <property name="systemCacheMemorySize" value="41943040"/>
+                <property name="systemCacheInitialSize" value="#{40 * 1024 * 1024}"/>
+                <property name="systemCacheMaxSize" value="#{40 * 1024 * 1024}"/>
                 <property name="defaultMemoryPolicyName" value="dfltPlc"/>
 
                 <property name="memoryPolicies">
                     <list>
                         <bean class="org.apache.ignite.configuration.MemoryPolicyConfiguration">
                             <property name="name" value="dfltPlc"/>
-                            <property name="size" value="103833600"/>
+                            <property name="maxSize" value="103833600"/>
+                            <property name="initialSize" value="103833600"/>
                         </bean>
                     </list>
                 </property>

http://git-wip-us.apache.org/repos/asf/ignite/blob/11c23b62/modules/platforms/cpp/core-test/config/cache-query-continuous-32.xml
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core-test/config/cache-query-continuous-32.xml b/modules/platforms/cpp/core-test/config/cache-query-continuous-32.xml
index b5f9854..84a5c60 100644
--- a/modules/platforms/cpp/core-test/config/cache-query-continuous-32.xml
+++ b/modules/platforms/cpp/core-test/config/cache-query-continuous-32.xml
@@ -29,14 +29,16 @@
     <bean parent="grid.cfg">
         <property name="memoryConfiguration">
             <bean class="org.apache.ignite.configuration.MemoryConfiguration">
-                <property name="systemCacheMemorySize" value="41943040"/>
+                <property name="systemCacheInitialSize" value="#{40 * 1024 * 1024}"/>
+                <property name="systemCacheMaxSize" value="#{40 * 1024 * 1024}"/>
                 <property name="defaultMemoryPolicyName" value="dfltPlc"/>
 
                 <property name="memoryPolicies">
                     <list>
                         <bean class="org.apache.ignite.configuration.MemoryPolicyConfiguration">
                             <property name="name" value="dfltPlc"/>
-                            <property name="size" value="103833600"/>
+                            <property name="maxSize" value="103833600"/>
+                            <property name="initialSize" value="103833600"/>
                         </bean>
                     </list>
                 </property>

http://git-wip-us.apache.org/repos/asf/ignite/blob/11c23b62/modules/platforms/cpp/core-test/config/cache-store-32.xml
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core-test/config/cache-store-32.xml b/modules/platforms/cpp/core-test/config/cache-store-32.xml
index f2b6682..ed46d4e 100644
--- a/modules/platforms/cpp/core-test/config/cache-store-32.xml
+++ b/modules/platforms/cpp/core-test/config/cache-store-32.xml
@@ -33,14 +33,16 @@
     <bean parent="grid.cfg">
         <property name="memoryConfiguration">
             <bean class="org.apache.ignite.configuration.MemoryConfiguration">
-                <property name="systemCacheMemorySize" value="#{40 * 1024 * 1024}"/>
+                <property name="systemCacheInitialSize" value="#{40 * 1024 * 1024}"/>
+                <property name="systemCacheMaxSize" value="#{40 * 1024 * 1024}"/>
                 <property name="defaultMemoryPolicyName" value="dfltPlc"/>
 
                 <property name="memoryPolicies">
                     <list>
                         <bean class="org.apache.ignite.configuration.MemoryPolicyConfiguration">
                             <property name="name" value="dfltPlc"/>
-                            <property name="size" value="#{100 * 1024 * 1024}"/>
+                            <property name="maxSize" value="#{100 * 1024 * 1024}"/>
+                            <property name="initialSize" value="#{100 * 1024 * 1024}"/>
                         </bean>
                     </list>
                 </property>

http://git-wip-us.apache.org/repos/asf/ignite/blob/11c23b62/modules/platforms/cpp/core-test/config/cache-test-32.xml
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core-test/config/cache-test-32.xml b/modules/platforms/cpp/core-test/config/cache-test-32.xml
index 3535ae4..889f246 100644
--- a/modules/platforms/cpp/core-test/config/cache-test-32.xml
+++ b/modules/platforms/cpp/core-test/config/cache-test-32.xml
@@ -33,14 +33,16 @@
     <bean parent="grid.cfg">
         <property name="memoryConfiguration">
             <bean class="org.apache.ignite.configuration.MemoryConfiguration">
-                <property name="systemCacheMemorySize" value="41943040"/>
+                <property name="systemCacheInitialSize" value="#{40 * 1024 * 1024}"/>
+                <property name="systemCacheMaxSize" value="#{40 * 1024 * 1024}"/>
                 <property name="defaultMemoryPolicyName" value="dfltPlc"/>
 
                 <property name="memoryPolicies">
                     <list>
                         <bean class="org.apache.ignite.configuration.MemoryPolicyConfiguration">
                             <property name="name" value="dfltPlc"/>
-                            <property name="size" value="103833600"/>
+                            <property name="maxSize" value="103833600"/>
+                            <property name="initialSize" value="103833600"/>
                         </bean>
                     </list>
                 </property>

http://git-wip-us.apache.org/repos/asf/ignite/blob/11c23b62/modules/platforms/cpp/odbc-test/config/queries-test-32.xml
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc-test/config/queries-test-32.xml b/modules/platforms/cpp/odbc-test/config/queries-test-32.xml
index dd7cfb6..f7d9ff4 100644
--- a/modules/platforms/cpp/odbc-test/config/queries-test-32.xml
+++ b/modules/platforms/cpp/odbc-test/config/queries-test-32.xml
@@ -30,14 +30,16 @@
     <bean parent="queries.cfg">
         <property name="memoryConfiguration">
             <bean class="org.apache.ignite.configuration.MemoryConfiguration">
-                <property name="systemCacheMemorySize" value="41943040"/>
+                <property name="systemCacheInitialSize" value="#{40 * 1024 * 1024}"/>
+                <property name="systemCacheMaxSize" value="#{40 * 1024 * 1024}"/>
                 <property name="defaultMemoryPolicyName" value="dfltPlc"/>
 
                 <property name="memoryPolicies">
                     <list>
                         <bean class="org.apache.ignite.configuration.MemoryPolicyConfiguration">
                             <property name="name" value="dfltPlc"/>
-                            <property name="size" value="103833600"/>
+                            <property name="maxSize" value="#{100 * 1024 * 1024}"/>
+                            <property name="initialSize" value="#{100 * 1024 * 1024}"/>
                         </bean>
                     </list>
                 </property>

http://git-wip-us.apache.org/repos/asf/ignite/blob/11c23b62/modules/platforms/cpp/odbc-test/config/queries-test-noodbc-32.xml
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc-test/config/queries-test-noodbc-32.xml b/modules/platforms/cpp/odbc-test/config/queries-test-noodbc-32.xml
index 8060107..01cae20 100644
--- a/modules/platforms/cpp/odbc-test/config/queries-test-noodbc-32.xml
+++ b/modules/platforms/cpp/odbc-test/config/queries-test-noodbc-32.xml
@@ -30,14 +30,16 @@
     <bean parent="ignite.cfg">
         <property name="memoryConfiguration">
             <bean class="org.apache.ignite.configuration.MemoryConfiguration">
-                <property name="systemCacheMemorySize" value="41943040"/>
+                <property name="systemCacheInitialSize" value="#{40 * 1024 * 1024}"/>
+                <property name="systemCacheMaxSize" value="#{40 * 1024 * 1024}"/>
                 <property name="defaultMemoryPolicyName" value="dfltPlc"/>
 
                 <property name="memoryPolicies">
                     <list>
                         <bean class="org.apache.ignite.configuration.MemoryPolicyConfiguration">
                             <property name="name" value="dfltPlc"/>
-                            <property name="size" value="103833600"/>
+                            <property name="maxSize" value="#{100 * 1024 * 1024}"/>
+                            <property name="initialSize" value="#{100 * 1024 * 1024}"/>
                         </bean>
                     </list>
                 </property>

http://git-wip-us.apache.org/repos/asf/ignite/blob/11c23b62/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheConfigurationTest.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheConfigurationTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheConfigurationTest.cs
index 9af103b..cf70970 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheConfigurationTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheConfigurationTest.cs
@@ -75,7 +75,8 @@ namespace Apache.Ignite.Core.Tests.Cache
                         new MemoryPolicyConfiguration
                         {
                             Name = "myMemPolicy",
-                            Size = 99 * 1024 * 1024
+                            InitialSize = 77 * 1024 * 1024,
+                            MaxSize = 99 * 1024 * 1024
                         }
                     }
                 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/11c23b62/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheMetricsTest.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheMetricsTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheMetricsTest.cs
index b409a5a..4b587a9 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheMetricsTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheMetricsTest.cs
@@ -165,7 +165,6 @@ namespace Apache.Ignite.Core.Tests.Cache
                 Assert.AreEqual(25, metrics.OffHeapPrimaryEntriesCount);
                 Assert.AreEqual(26, metrics.OffHeapBackupEntriesCount);
                 Assert.AreEqual(27, metrics.OffHeapAllocatedSize);
-                Assert.AreEqual(28, metrics.OffHeapMaxSize);
                 Assert.AreEqual(29, metrics.Size);
                 Assert.AreEqual(30, metrics.KeySize);
                 Assert.AreEqual(true, metrics.IsEmpty);

http://git-wip-us.apache.org/repos/asf/ignite/blob/11c23b62/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/spring-test.xml
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/spring-test.xml b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/spring-test.xml
index 2bf7478..dd0669a 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/spring-test.xml
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/spring-test.xml
@@ -42,5 +42,19 @@
                 <property name="socketTimeout" value="300" />
             </bean>
         </property>
+
+        <property name="memoryConfiguration">
+            <bean class="org.apache.ignite.configuration.MemoryConfiguration">
+                <property name="defaultMemoryPolicyName" value="dfltPlc"/>
+
+                <property name="memoryPolicies">
+                    <list>
+                        <bean class="org.apache.ignite.configuration.MemoryPolicyConfiguration">
+                            <property name="name" value="dfltPlc"/>
+                        </bean>
+                    </list>
+                </property>
+            </bean>
+        </property>
     </bean>
 </beans>

http://git-wip-us.apache.org/repos/asf/ignite/blob/11c23b62/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationSerializerTest.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationSerializerTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationSerializerTest.cs
index dfd0d09..bc0321e 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationSerializerTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationSerializerTest.cs
@@ -134,9 +134,9 @@ namespace Apache.Ignite.Core.Tests
                                 <iPluginConfiguration type='Apache.Ignite.Core.Tests.Plugin.TestIgnitePluginConfiguration, Apache.Ignite.Core.Tests' />
                             </pluginConfigurations>
                             <eventStorageSpi type='MemoryEventStorageSpi' expirationTimeout='00:00:23.45' maxEventCount='129' />
-                            <memoryConfiguration concurrencyLevel='3' defaultMemoryPolicyName='dfPlc' pageSize='45' systemCacheMemorySize='67'>
+                            <memoryConfiguration concurrencyLevel='3' defaultMemoryPolicyName='dfPlc' pageSize='45' systemCacheInitialSize='67' systemCacheMaxSize='68'>
                                 <memoryPolicies>
-                                    <memoryPolicyConfiguration emptyPagesPoolSize='1' evictionThreshold='0.2' name='dfPlc' pageEvictionMode='RandomLru' size='89' swapFilePath='abc' />
+                                    <memoryPolicyConfiguration emptyPagesPoolSize='1' evictionThreshold='0.2' name='dfPlc' pageEvictionMode='RandomLru' initialSize='89' maxSize='98' swapFilePath='abc' />
                                 </memoryPolicies>
                             </memoryConfiguration>
                         </igniteConfig>";
@@ -261,7 +261,8 @@ namespace Apache.Ignite.Core.Tests
             Assert.AreEqual(3, memCfg.ConcurrencyLevel);
             Assert.AreEqual("dfPlc", memCfg.DefaultMemoryPolicyName);
             Assert.AreEqual(45, memCfg.PageSize);
-            Assert.AreEqual(67, memCfg.SystemCacheMemorySize);
+            Assert.AreEqual(67, memCfg.SystemCacheInitialSize);
+            Assert.AreEqual(68, memCfg.SystemCacheMaxSize);
 
             var memPlc = memCfg.MemoryPolicies.Single();
             Assert.AreEqual(1, memPlc.EmptyPagesPoolSize);
@@ -269,7 +270,8 @@ namespace Apache.Ignite.Core.Tests
             Assert.AreEqual("dfPlc", memPlc.Name);
             Assert.AreEqual(DataPageEvictionMode.RandomLru, memPlc.PageEvictionMode);
             Assert.AreEqual("abc", memPlc.SwapFilePath);
-            Assert.AreEqual(89, memPlc.Size);
+            Assert.AreEqual(89, memPlc.InitialSize);
+            Assert.AreEqual(98, memPlc.MaxSize);
         }
 
         /// <summary>
@@ -804,14 +806,16 @@ namespace Apache.Ignite.Core.Tests
                     ConcurrencyLevel = 3,
                     DefaultMemoryPolicyName = "somePolicy",
                     PageSize = 4,
-                    SystemCacheMemorySize = 5,
+                    SystemCacheInitialSize = 5,
+                    SystemCacheMaxSize = 6,
                     MemoryPolicies = new[]
                     {
                         new MemoryPolicyConfiguration
                         {
                             Name = "myDefaultPlc",
                             PageEvictionMode = DataPageEvictionMode.Random2Lru,
-                            Size = 345 * 1024 * 1024,
+                            InitialSize = 245 * 1024 * 1024,
+                            MaxSize = 345 * 1024 * 1024,
                             EvictionThreshold = 0.88,
                             EmptyPagesPoolSize = 77,
                             SwapFilePath = "myPath1"
@@ -820,7 +824,6 @@ namespace Apache.Ignite.Core.Tests
                         {
                             Name = "customPlc",
                             PageEvictionMode = DataPageEvictionMode.RandomLru,
-                            Size = 456 * 1024 * 1024,
                             EvictionThreshold = 0.77,
                             EmptyPagesPoolSize = 66,
                             SwapFilePath = "somePath2"

http://git-wip-us.apache.org/repos/asf/ignite/blob/11c23b62/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationTest.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationTest.cs
index 5f4a8ca..ebca7c4 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationTest.cs
@@ -199,7 +199,8 @@ namespace Apache.Ignite.Core.Tests
                 Assert.AreEqual(memCfg.PageSize, resMemCfg.PageSize);
                 Assert.AreEqual(memCfg.ConcurrencyLevel, resMemCfg.ConcurrencyLevel);
                 Assert.AreEqual(memCfg.DefaultMemoryPolicyName, resMemCfg.DefaultMemoryPolicyName);
-                Assert.AreEqual(memCfg.SystemCacheMemorySize, resMemCfg.SystemCacheMemorySize);
+                Assert.AreEqual(memCfg.SystemCacheInitialSize, resMemCfg.SystemCacheInitialSize);
+                Assert.AreEqual(memCfg.SystemCacheMaxSize, resMemCfg.SystemCacheMaxSize);
                 Assert.IsNotNull(memCfg.MemoryPolicies);
                 Assert.IsNotNull(resMemCfg.MemoryPolicies);
                 Assert.AreEqual(2, memCfg.MemoryPolicies.Count);
@@ -211,7 +212,7 @@ namespace Apache.Ignite.Core.Tests
                     var resPlc = resMemCfg.MemoryPolicies.Skip(i).First();
 
                     Assert.AreEqual(plc.PageEvictionMode, resPlc.PageEvictionMode);
-                    Assert.AreEqual(plc.Size, resPlc.Size);
+                    Assert.AreEqual(plc.MaxSize, resPlc.MaxSize);
                     Assert.AreEqual(plc.EmptyPagesPoolSize, resPlc.EmptyPagesPoolSize);
                     Assert.AreEqual(plc.EvictionThreshold, resPlc.EvictionThreshold);
                     Assert.AreEqual(plc.Name, resPlc.Name);
@@ -245,6 +246,22 @@ namespace Apache.Ignite.Core.Tests
                 var disco = resCfg.DiscoverySpi as TcpDiscoverySpi;
                 Assert.IsNotNull(disco);
                 Assert.AreEqual(TimeSpan.FromMilliseconds(300), disco.SocketTimeout);
+
+                // Check memory configuration defaults.
+                var mem = resCfg.MemoryConfiguration;
+
+                Assert.IsNotNull(mem);
+                Assert.AreEqual("dfltPlc", mem.DefaultMemoryPolicyName);
+                Assert.AreEqual(MemoryConfiguration.DefaultPageSize, mem.PageSize);
+                Assert.AreEqual(MemoryConfiguration.DefaultSystemCacheInitialSize, mem.SystemCacheInitialSize);
+                Assert.AreEqual(MemoryConfiguration.DefaultSystemCacheMaxSize, mem.SystemCacheMaxSize);
+
+                var plc = mem.MemoryPolicies.Single();
+                Assert.AreEqual("dfltPlc", plc.Name);
+                Assert.AreEqual(MemoryPolicyConfiguration.DefaultEmptyPagesPoolSize, plc.EmptyPagesPoolSize);
+                Assert.AreEqual(MemoryPolicyConfiguration.DefaultEvictionThreshold, plc.EvictionThreshold);
+                Assert.AreEqual(MemoryPolicyConfiguration.DefaultInitialSize, plc.InitialSize);
+                Assert.AreEqual(MemoryPolicyConfiguration.DefaultMaxSize, plc.MaxSize);
             }
         }
 
@@ -446,7 +463,9 @@ namespace Apache.Ignite.Core.Tests
         {
             var props = obj.GetType().GetProperties();
 
-            foreach (var prop in props.Where(p => p.Name != "SelectorsCount" && p.Name != "ReadStripesNumber"))
+            foreach (var prop in props.Where(p => p.Name != "SelectorsCount" && p.Name != "ReadStripesNumber" &&
+                                                  !(p.Name == "MaxSize" &&
+                                                    p.DeclaringType == typeof(MemoryPolicyConfiguration))))
             {
                 var attr = prop.GetCustomAttributes(true).OfType<DefaultValueAttribute>().FirstOrDefault();
                 var propValue = prop.GetValue(obj, null);
@@ -567,14 +586,15 @@ namespace Apache.Ignite.Core.Tests
                     ConcurrencyLevel = 3,
                     DefaultMemoryPolicyName = "myDefaultPlc",
                     PageSize = 2048,
-                    SystemCacheMemorySize = 13 * 1024 * 1024,
+                    SystemCacheInitialSize = 13 * 1024 * 1024,
+                    SystemCacheMaxSize = 15 * 1024 * 1024,
                     MemoryPolicies = new[]
                     {
                         new MemoryPolicyConfiguration
                         {
                             Name = "myDefaultPlc",
                             PageEvictionMode = DataPageEvictionMode.Random2Lru,
-                            Size = 345 * 1024 * 1024,
+                            MaxSize = 345 * 1024 * 1024,
                             EvictionThreshold = 0.88,
                             EmptyPagesPoolSize = 77,
                             SwapFilePath = "myPath1"
@@ -583,7 +603,7 @@ namespace Apache.Ignite.Core.Tests
                         {
                             Name = "customPlc",
                             PageEvictionMode = DataPageEvictionMode.RandomLru,
-                            Size = 456 * 1024 * 1024,
+                            MaxSize = 456 * 1024 * 1024,
                             EvictionThreshold = 0.77,
                             EmptyPagesPoolSize = 66,
                             SwapFilePath = "somePath2"

http://git-wip-us.apache.org/repos/asf/ignite/blob/11c23b62/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Configuration/DataPageEvictionMode.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Configuration/DataPageEvictionMode.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Configuration/DataPageEvictionMode.cs
index f3897e6..a6263d7 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Configuration/DataPageEvictionMode.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Configuration/DataPageEvictionMode.cs
@@ -34,10 +34,10 @@ namespace Apache.Ignite.Core.Cache.Configuration
         /// <para />
         /// Once a memory region defined by a memory policy is configured, an off-heap array is allocated to track
         /// last usage timestamp for every individual data page. The size of the array equals to
-        /// <see cref="MemoryPolicyConfiguration.Size"/> / <see cref="MemoryConfiguration.PageSize"/>.
+        /// <see cref="MemoryPolicyConfiguration.MaxSize"/> / <see cref="MemoryConfiguration.PageSize"/>.
         /// <para />
         /// When a data page is accessed, its timestamp gets updated in the tracking array. The page index in the
-        /// tracking array equals to pageAddress / <see cref="MemoryPolicyConfiguration.Size"/>.
+        /// tracking array equals to pageAddress / <see cref="MemoryPolicyConfiguration.MaxSize"/>.
         /// <para />
         /// When some pages need to be evicted, the algorithm randomly chooses 5 indexes from the tracking array and
         /// evicts a page with the latest timestamp. If some of the indexes point to non-data pages

http://git-wip-us.apache.org/repos/asf/ignite/blob/11c23b62/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Configuration/MemoryConfiguration.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Configuration/MemoryConfiguration.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Configuration/MemoryConfiguration.cs
index 9c4bb35..36d06a7 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Configuration/MemoryConfiguration.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Configuration/MemoryConfiguration.cs
@@ -46,9 +46,14 @@ namespace Apache.Ignite.Core.Cache.Configuration
     public class MemoryConfiguration
     {
         /// <summary>
-        /// The default system cache memory size.
+        /// Default size of a memory chunk reserved for system cache initially.
         /// </summary>
-        public const long DefaultSystemCacheMemorySize = 100 * 1024 * 1024;
+        public const long DefaultSystemCacheInitialSize = 40 * 1024 * 1024;
+
+        /// <summary>
+        /// Default max size of a memory chunk for the system cache.
+        /// </summary>
+        public const long DefaultSystemCacheMaxSize = 100 * 1024 * 1024;
 
         /// <summary>
         /// The default page size.
@@ -65,7 +70,8 @@ namespace Apache.Ignite.Core.Cache.Configuration
         /// </summary>
         public MemoryConfiguration()
         {
-            SystemCacheMemorySize = DefaultSystemCacheMemorySize;
+            SystemCacheInitialSize = DefaultSystemCacheInitialSize;
+            SystemCacheMaxSize = DefaultSystemCacheMaxSize;
             PageSize = DefaultPageSize;
             DefaultMemoryPolicyName = DefaultDefaultMemoryPolicyName;
         }
@@ -78,7 +84,8 @@ namespace Apache.Ignite.Core.Cache.Configuration
         {
             Debug.Assert(reader != null);
 
-            SystemCacheMemorySize = reader.ReadLong();
+            SystemCacheInitialSize = reader.ReadLong();
+            SystemCacheMaxSize = reader.ReadLong();
             PageSize = reader.ReadInt();
             ConcurrencyLevel = reader.ReadInt();
             DefaultMemoryPolicyName = reader.ReadString();
@@ -101,7 +108,8 @@ namespace Apache.Ignite.Core.Cache.Configuration
         {
             Debug.Assert(writer != null);
 
-            writer.WriteLong(SystemCacheMemorySize);
+            writer.WriteLong(SystemCacheInitialSize);
+            writer.WriteLong(SystemCacheMaxSize);
             writer.WriteInt(PageSize);
             writer.WriteInt(ConcurrencyLevel);
             writer.WriteString(DefaultMemoryPolicyName);
@@ -129,8 +137,14 @@ namespace Apache.Ignite.Core.Cache.Configuration
         /// <summary>
         /// Gets or sets the size of a memory chunk reserved for system cache needs.
         /// </summary>
-        [DefaultValue(DefaultSystemCacheMemorySize)]
-        public long SystemCacheMemorySize { get; set; }
+        [DefaultValue(DefaultSystemCacheInitialSize)]
+        public long SystemCacheInitialSize { get; set; }
+
+        /// <summary>
+        /// Gets or sets the maximum memory region size reserved for system cache.
+        /// </summary>
+        [DefaultValue(DefaultSystemCacheMaxSize)]
+        public long SystemCacheMaxSize { get; set; }
 
         /// <summary>
         /// Gets or sets the size of the memory page.

http://git-wip-us.apache.org/repos/asf/ignite/blob/11c23b62/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Configuration/MemoryPolicyConfiguration.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Configuration/MemoryPolicyConfiguration.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Configuration/MemoryPolicyConfiguration.cs
index fe4e91f..e6e9153 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Configuration/MemoryPolicyConfiguration.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Configuration/MemoryPolicyConfiguration.cs
@@ -19,6 +19,7 @@ namespace Apache.Ignite.Core.Cache.Configuration
 {
     using System.ComponentModel;
     using Apache.Ignite.Core.Binary;
+    using Apache.Ignite.Core.Impl;
 
     /// <summary>
     /// Defines page memory policy configuration. See <see cref="MemoryConfiguration.MemoryPolicies"/>.
@@ -36,6 +37,16 @@ namespace Apache.Ignite.Core.Cache.Configuration
         public const int DefaultEmptyPagesPoolSize = 100;
 
         /// <summary>
+        /// The default initial size.
+        /// </summary>
+        public const long DefaultInitialSize = 256 * 1024 * 1024;
+
+        /// <summary>
+        /// The default maximum size, equals to 80% of total RAM.
+        /// </summary>
+        public static readonly long DefaultMaxSize = (long) ((long) NativeMethods.GetTotalPhysicalMemory() * 0.8);
+
+        /// <summary>
         /// Initializes a new instance of the <see cref="MemoryPolicyConfiguration"/> class.
         /// </summary>
         public MemoryPolicyConfiguration()
@@ -43,6 +54,8 @@ namespace Apache.Ignite.Core.Cache.Configuration
             EvictionThreshold = DefaultEvictionThreshold;
             EmptyPagesPoolSize = DefaultEmptyPagesPoolSize;
             Name = MemoryConfiguration.DefaultDefaultMemoryPolicyName;
+            InitialSize = DefaultInitialSize;
+            MaxSize = DefaultMaxSize;
         }
 
         /// <summary>
@@ -52,7 +65,8 @@ namespace Apache.Ignite.Core.Cache.Configuration
         internal MemoryPolicyConfiguration(IBinaryRawReader reader)
         {
             Name = reader.ReadString();
-            Size = reader.ReadLong();
+            InitialSize = reader.ReadLong();
+            MaxSize = reader.ReadLong();
             SwapFilePath = reader.ReadString();
             PageEvictionMode = (DataPageEvictionMode) reader.ReadInt();
             EvictionThreshold = reader.ReadDouble();
@@ -65,7 +79,8 @@ namespace Apache.Ignite.Core.Cache.Configuration
         internal void Write(IBinaryRawWriter writer)
         {
             writer.WriteString(Name);
-            writer.WriteLong(Size);
+            writer.WriteLong(InitialSize);
+            writer.WriteLong(MaxSize);
             writer.WriteString(SwapFilePath);
             writer.WriteInt((int) PageEvictionMode);
             writer.WriteDouble(EvictionThreshold);
@@ -80,10 +95,17 @@ namespace Apache.Ignite.Core.Cache.Configuration
         public string Name { get; set; }
 
         /// <summary>
-        /// Gets or sets the maximum memory region size defined by this memory policy.
-        /// If the whole data can not fit into the memory region an out of memory exception will be thrown.
+        /// Gets or sets initial memory region size defined by this memory policy.
+        /// When the used memory size exceeds this value, new chunks of memory will be allocated.
+        /// </summary>
+        [DefaultValue(DefaultInitialSize)]
+        public long InitialSize { get; set; }
+
+        /// <summary>
+        /// Sets maximum memory region size defined by this memory policy. The total size should not be less
+        /// than 10 MB due to internal data structures overhead.
         /// </summary>
-        public long Size { get; set; }
+        public long MaxSize { get; set; }
 
         /// <summary>
         /// Gets or sets the the path to the memory-mapped file the memory region defined by this memory policy
@@ -97,7 +119,7 @@ namespace Apache.Ignite.Core.Cache.Configuration
         /// <summary>
         /// Gets or sets the page eviction mode. If <see cref="DataPageEvictionMode.Disabled"/> is used (default)
         /// then an out of memory exception will be thrown if the memory region usage,
-        /// defined by this memory policy, goes beyond <see cref="Size"/>.
+        /// defined by this memory policy, goes beyond <see cref="MaxSize"/>.
         /// </summary>
         public DataPageEvictionMode PageEvictionMode { get; set; }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/11c23b62/modules/platforms/dotnet/Apache.Ignite.Core/Cache/ICacheMetrics.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/ICacheMetrics.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/ICacheMetrics.cs
index 596322b..8289aaf 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/ICacheMetrics.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/ICacheMetrics.cs
@@ -249,14 +249,6 @@ namespace Apache.Ignite.Core.Cache
         long OffHeapAllocatedSize { get; }
 
         /// <summary>
-        /// Gets off-heap memory maximum size.
-        /// </summary>
-        /// <returns>
-        /// Off-heap memory maximum size.
-        /// </returns>
-        long OffHeapMaxSize { get; }
-
-        /// <summary>
         /// Gets number of non-null values in the cache.
         /// </summary>
         /// <returns>

http://git-wip-us.apache.org/repos/asf/ignite/blob/11c23b62/modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfigurationSection.xsd
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfigurationSection.xsd b/modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfigurationSection.xsd
index 9098d89..295457a 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfigurationSection.xsd
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfigurationSection.xsd
@@ -1183,7 +1183,12 @@
                                                         <xs:documentation>Page eviction mode.</xs:documentation>
                                                     </xs:annotation>
                                                 </xs:attribute>
-                                                <xs:attribute name="size" type="xs:int" use="required">
+                                                <xs:attribute name="initialSize" type="xs:long">
+                                                    <xs:annotation>
+                                                        <xs:documentation>Initial memory region size defined by this memory policy.</xs:documentation>
+                                                    </xs:annotation>
+                                                </xs:attribute>
+                                                <xs:attribute name="maxSize" type="xs:long">
                                                     <xs:annotation>
                                                         <xs:documentation>Maximum memory region size defined by this memory policy.</xs:documentation>
                                                     </xs:annotation>
@@ -1214,9 +1219,14 @@
                                 <xs:documentation>Size of the memory page.</xs:documentation>
                             </xs:annotation>
                         </xs:attribute>
-                        <xs:attribute name="systemCacheMemorySize" type="xs:int">
+                        <xs:attribute name="systemCacheInitialSize" type="xs:int">
+                            <xs:annotation>
+                                <xs:documentation>Initial size of a memory chunk reserved for system cache needs.</xs:documentation>
+                            </xs:annotation>
+                        </xs:attribute>
+                        <xs:attribute name="systemCacheMaxSize" type="xs:int">
                             <xs:annotation>
-                                <xs:documentation>Size of a memory chunk reserved for system cache needs.</xs:documentation>
+                                <xs:documentation>Maximum size of a memory chunk reserved for system cache needs.</xs:documentation>
                             </xs:annotation>
                         </xs:attribute>
                     </xs:complexType>

http://git-wip-us.apache.org/repos/asf/ignite/blob/11c23b62/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/CacheMetricsImpl.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/CacheMetricsImpl.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/CacheMetricsImpl.cs
index 53ff810..9ce713f 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/CacheMetricsImpl.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/CacheMetricsImpl.cs
@@ -110,9 +110,6 @@ namespace Apache.Ignite.Core.Impl.Cache
         private readonly long _offHeapAllocatedSize;
 
         /** */
-        private readonly long _offHeapMaxSize;
-
-        /** */
         private readonly int _size;
 
         /** */
@@ -248,7 +245,6 @@ namespace Apache.Ignite.Core.Impl.Cache
             _offHeapPrimaryEntriesCount = reader.ReadLong();
             _offHeapBackupEntriesCount = reader.ReadLong();
             _offHeapAllocatedSize = reader.ReadLong();
-            _offHeapMaxSize = reader.ReadLong();
             _size = reader.ReadInt();
             _keySize = reader.ReadInt();
             _isEmpty = reader.ReadBoolean();
@@ -370,9 +366,6 @@ namespace Apache.Ignite.Core.Impl.Cache
         public long OffHeapAllocatedSize { get { return _offHeapAllocatedSize; } }
 
         /** <inheritDoc /> */
-        public long OffHeapMaxSize { get { return _offHeapMaxSize; } }
-
-        /** <inheritDoc /> */
         public int Size { get { return _size; } }
 
         /** <inheritDoc /> */

http://git-wip-us.apache.org/repos/asf/ignite/blob/11c23b62/modules/platforms/dotnet/Apache.Ignite.Core/Impl/NativeMethods.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/NativeMethods.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/NativeMethods.cs
index 3403dee..0004772 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/NativeMethods.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/NativeMethods.cs
@@ -45,5 +45,49 @@ namespace Apache.Ignite.Core.Impl
         [DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Ansi, BestFitMapping = false, 
             ThrowOnUnmappableChar = true)]
         internal static extern IntPtr LoadLibrary(string path);
+
+        /// <summary>
+        /// Gets the total physical memory.
+        /// </summary>
+        internal static ulong GetTotalPhysicalMemory()
+        {
+            var status = new MEMORYSTATUSEX();
+            status.Init();
+
+            GlobalMemoryStatusEx(ref status);
+
+            return status.ullTotalPhys;
+        }
+
+        /// <summary>
+        /// Globals the memory status.
+        /// </summary>
+        [return: MarshalAs(UnmanagedType.Bool)]
+        [DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
+        private static extern bool GlobalMemoryStatusEx([In, Out] ref MEMORYSTATUSEX lpBuffer);
+
+        [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
+        // ReSharper disable InconsistentNaming
+        // ReSharper disable MemberCanBePrivate.Local
+        private struct MEMORYSTATUSEX
+        {
+            public uint dwLength;
+            public readonly uint dwMemoryLoad;
+            public readonly ulong ullTotalPhys;
+            public readonly ulong ullAvailPhys;
+            public readonly ulong ullTotalPageFile;
+            public readonly ulong ullAvailPageFile;
+            public readonly ulong ullTotalVirtual;
+            public readonly ulong ullAvailVirtual;
+            public readonly ulong ullAvailExtendedVirtual;
+
+            /// <summary>
+            /// Initializes a new instance of the <see cref="MEMORYSTATUSEX"/> struct.
+            /// </summary>
+            public void Init()
+            {
+                dwLength = (uint) Marshal.SizeOf(typeof(MEMORYSTATUSEX));
+            }
+        }
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/11c23b62/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 9c6a0d7..9a672cc 100644
--- a/pom.xml
+++ b/pom.xml
@@ -524,7 +524,7 @@
                                         <mkdir dir="${basedir}/target/release-package/benchmarks" />
 
                                         <copy todir="${basedir}/target/release-package/benchmarks/">
-                                            <fileset dir="${basedir}/modules/yardstick/target/assembly/"/>
+                                            <fileset dir="${basedir}/modules/yardstick/target/assembly/" />
                                         </copy>
 
                                         <!--todo: only required jars should be exported to /benchmarks/libs during compilation-->
@@ -541,38 +541,38 @@
                                         <delete>
                                             <fileset dir="${basedir}/target/release-package/benchmarks/config/">
                                                 <include name="*.*" />
-                                                <exclude name="benchmark.properties"/>
-                                                <exclude name="benchmark-remote.properties"/>
-                                                <exclude name="benchmark-sample.properties"/>
-                                                <exclude name="benchmark-remote-sample.properties"/>
-                                                <exclude name="benchmark-multicast.properties"/>
-                                                <exclude name="ignite-base-config.xml"/>
-                                                <exclude name="ignite-localhost-config.xml"/>
-                                                <exclude name="ignite-remote-config.xml"/>
-                                                <exclude name="ignite-multicast-config.xml"/>
+                                                <exclude name="benchmark.properties" />
+                                                <exclude name="benchmark-remote.properties" />
+                                                <exclude name="benchmark-sample.properties" />
+                                                <exclude name="benchmark-remote-sample.properties" />
+                                                <exclude name="benchmark-multicast.properties" />
+                                                <exclude name="ignite-base-config.xml" />
+                                                <exclude name="ignite-localhost-config.xml" />
+                                                <exclude name="ignite-remote-config.xml" />
+                                                <exclude name="ignite-multicast-config.xml" />
                                             </fileset>
                                         </delete>
 
                                         <mkdir dir="${basedir}/target/release-package/benchmarks/sources/src" />
 
                                         <copy todir="${basedir}/target/release-package/benchmarks/sources/src/">
-                                            <fileset dir="${basedir}/modules/yardstick/src"/>
+                                            <fileset dir="${basedir}/modules/yardstick/src" />
                                         </copy>
 
                                         <mkdir dir="${basedir}/target/release-package/benchmarks/sources/config" />
 
                                         <copy todir="${basedir}/target/release-package/benchmarks/sources/config/">
-                                            <fileset dir="${basedir}/target/release-package/benchmarks/config"/>
+                                            <fileset dir="${basedir}/target/release-package/benchmarks/config" />
                                         </copy>
 
                                         <copy file="${basedir}/modules/yardstick/pom-standalone.xml"
                                               tofile="${basedir}/target/release-package/benchmarks/sources/pom.xml"/>
 
                                         <replaceregexp byline="true">
-                                            <regexp pattern="to_be_replaced_by_ignite_version"/>
-                                            <substitution expression="${project.version}"/>
-                                            <fileset dir="${basedir}/target/release-package/benchmarks/sources/" >
-                                                <include name="pom.xml"/>
+                                            <regexp pattern="to_be_replaced_by_ignite_version" />
+                                            <substitution expression="${project.version}" />
+                                            <fileset dir="${basedir}/target/release-package/benchmarks/sources/">
+                                                <include name="pom.xml" />
                                             </fileset>
                                         </replaceregexp>