Denis, I found an issue with the example: each cache introduces some memory overhead (mostly for cache partitions data structures) and it must be counted in MemoryPolicy size.
To fix the example just increase size of *10MB_Region_Eviction *to 15 MB and *5MB_Region_Swapping *to 10 MB. I didn't find any documentation on this, but I think it is part of new PageMemory-based storage so it needs to be documented as part of ignite-2.0 release. Thanks, Sergey. On Mon, Apr 17, 2017 at 2:50 PM, Sergey Chugunov <sergey.chugu...@gmail.com> wrote: > Denis, > > It looks like partition exchange mechanism allocates a lot of pages right > after the cache is started. > I'm trying to figure out what's going on. > > Thanks, > Sergey. > > On Mon, Apr 17, 2017 at 12:05 AM, Denis Magda <dma...@apache.org> wrote: > >> Igniters, >> >> I’ve created a simple example to demonstrate how to set up various >> policies: >> https://github.com/apache/ignite/blob/master/examples/src/ >> main/java/org/apache/ignite/examples/datagrid/MemoryPoliciesExample.java >> >> However, this tiny example fails with >> >> Caused by: class org.apache.ignite.internal.mem.OutOfMemoryException: >> null >> at org.apache.ignite.internal.pagemem.impl.PageMemoryNoStoreImp >> l.allocatePage(PageMemoryNoStoreImpl.java:255) >> at org.apache.ignite.internal.processors.cache.IgniteCacheOffhe >> apManagerImpl.allocateForTree(IgniteCacheOffheapManagerImpl.java:635) >> at org.apache.ignite.internal.processors.cache.IgniteCacheOffhe >> apManagerImpl.createCacheDataStore0(IgniteCacheOffheapManage >> rImpl.java:727) >> at org.apache.ignite.internal.processors.cache.IgniteCacheOffhe >> apManagerImpl.createCacheDataStore(IgniteCacheOffheapManager >> Impl.java:711) >> at org.apache.ignite.internal.processors.cache.distributed.dht. >> GridDhtLocalPartition.<init>(GridDhtLocalPartition.java:162) >> at org.apache.ignite.internal.processors.cache.distributed.dht. >> GridDhtPartitionTopologyImpl.createPartition(GridDhtPartitio >> nTopologyImpl.java:718) >> at org.apache.ignite.internal.processors.cache.distributed.dht. >> GridDhtPartitionTopologyImpl.initPartitions0(GridDhtPartitio >> nTopologyImpl.java:405) >> at org.apache.ignite.internal.processors.cache.distributed.dht. >> GridDhtPartitionTopologyImpl.beforeExchange(GridDhtPartition >> TopologyImpl.java:569) >> at org.apache.ignite.internal.processors.cache.distributed.dht. >> preloader.GridDhtPartitionsExchangeFuture.distributedExchange(GridDhtPar >> titionsExchangeFuture.java:844) >> at org.apache.ignite.internal.processors.cache.distributed.dht. >> preloader.GridDhtPartitionsExchangeFuture.init(GridDhtPartit >> ionsExchangeFuture.java:573) >> at org.apache.ignite.internal.processors.cache.GridCachePartiti >> onExchangeManager$ExchangeWorker.body(GridCacheP >> artitionExchangeManager.java:1800) >> ... 2 more >> >> >> >> What I’m doing wrong? Alex G., could you take a look? Probably I’m >> missing something due to a lack of documentation. >> >> — >> Denis >> >> >