You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by Seshu Pasam <ig...@pasam.com> on 2015/12/24 17:42:18 UTC

Eviction for OFFHEAP_TIERED vs OFFHEAP_VALUES

I am trying to use OFFHEAP_VALUES with offHeapMaxMemory (1G). I configured
LRU eviction with maxMemorySize set to 1G (same as offHeapMaxMemory). When I
put a large number of entries in the cache, I expected offHeap entries to
get evicted. But it seems like offHeap is growing beyond configured limit
(1G).

I am not interested in using swap space. This seems to work fine with
OFFHEAP_TIERED. Is this a bug or known issue?

Thanks
-Seshu

Version: 1.5.0b1
Configuration:
                <bean
class="org.apache.ignite.configuration.CacheConfiguration"
                    p:offHeapMaxMemory="#{1 * 1024L * 1024L * 1024L}"
                    p:cacheMode="PARTITIONED"
                    p:memoryMode="OFFHEAP_TIERED"
                    p:swapEnabled="false"
...
                    <property name="evictionPolicy">
                        <bean
class="org.apache.ignite.cache.eviction.lru.LruEvictionPolicy"
                            p:maxMemorySize="#{1 * 1024L * 1024L * 1024L}"/>
                    </property>
                </bean>



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Eviction-for-OFFHEAP-TIERED-vs-OFFHEAP-VALUES-tp2302.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: Eviction for OFFHEAP_TIERED vs OFFHEAP_VALUES

Posted by Seshu Pasam <ig...@pasam.com>.
Val, thanks for your response. I am using 1.5.0-b1 version. Here is the
configuration I used to start the server. Also attached is test case. I am
inserting 5000 cache entries. Each entry is 1MB. Max offheap size is 1GB. I
think in this case, the get() test should not pass unless offheap stored all
5GB worth of data. See attached

Thanks
-Seshu

c.xml <http://apache-ignite-users.70518.x6.nabble.com/file/n2310/c.xml>  
LiveCacheTest.java
<http://apache-ignite-users.70518.x6.nabble.com/file/n2310/LiveCacheTest.java>  



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Eviction-for-OFFHEAP-TIERED-vs-OFFHEAP-VALUES-tp2302p2310.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: Eviction for OFFHEAP_TIERED vs OFFHEAP_VALUES

Posted by vkulichenko <va...@gmail.com>.
Hi Seshu,

The issue is not reproduced for me. How do you check current memory size of
the cache? Do you have a failing test that you can share with us?

-Val



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Eviction-for-OFFHEAP-TIERED-vs-OFFHEAP-VALUES-tp2302p2306.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

RE: Eviction for OFFHEAP_TIERED vs OFFHEAP_VALUES

Posted by Seshu Pasam <ig...@pasam.com>.
Val, thanks. There is only 1 server. And I used junit test (please refer to
my previous message)

-Seshu



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Eviction-for-OFFHEAP-TIERED-vs-OFFHEAP-VALUES-tp2302p2311.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

RE: Eviction for OFFHEAP_TIERED vs OFFHEAP_VALUES

Posted by vkulichenko <va...@gmail.com>.
Hi Greg,

Good point about several nodes in topology! Seshu, please keep in mind that
this is a per-node setting, so the limit is actually multiplied by the
number of nodes.

XML looks correct to me. Ignite uses Spring-based configuration, which
supports expressions and "p:" syntax via custom tags. Also the node would
fail with an explicit message if configuration is invalid.

-Val



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Eviction-for-OFFHEAP-TIERED-vs-OFFHEAP-VALUES-tp2302p2309.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

RE: Eviction for OFFHEAP_TIERED vs OFFHEAP_VALUES

Posted by vkulichenko <va...@gmail.com>.
Hi Seshu,

Thanks for the test, looks like it reproduces the issue. We will investigate
and fix it in 1.6. Here is the ticket:
https://issues.apache.org/jira/browse/IGNITE-2289

-Val



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Eviction-for-OFFHEAP-TIERED-vs-OFFHEAP-VALUES-tp2302p2318.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

RE: Eviction for OFFHEAP_TIERED vs OFFHEAP_VALUES

Posted by Seshu Pasam <ig...@pasam.com>.
Greg, thanks but the configuration is absolutely fine and am using it to
start the server. No it is not a cluster. There is only 1 server and a junit
test.

-Seshu



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Eviction-for-OFFHEAP-TIERED-vs-OFFHEAP-VALUES-tp2302p2312.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

RE: Eviction for OFFHEAP_TIERED vs OFFHEAP_VALUES

Posted by "Patnude, Greg" <Gr...@nordstrom.com>.
Seems to me that you didn't provide enough information to really assist in any way... 

One potential issue is that you are trying to do math in your properties with "#{1L * 1024L ...}. 

Also your configuration just doesn't feel right: 

You have "<bean class="org.apache.ignite.cache.eviction.lru.LruEvictionPolicy" p:maxMemorySize="#{1 * 1024L * 1024L * 1024L}"/>"

Which makes "p:maxMemorySize" a property named "p:maxMemorysize" which is a bit different that "maxMemorySize" 

You seem to be using some sort of JSF-XHTML syntax instead... I'd suggest you try and fix your configuration or do it programmatically but your XML looks wrong...

And your trailing slash here closes the bean but the docs are specifically using the nested property format:

<bean ...>
   <property />
   ... 
   </[property />
</bean>


Your configuration xml looks a bit hokey also - the docs show it like this but you are using inline property tags with your <bean class="something" p:propertyName="somevalue" syntax so it could be an XML parsing problem... 
 
<bean class="org.apache.ignite.cache.CacheConfiguration">
  <property name="name" value="myCache"/>
    ...
    <property name="evictionPolicy">
        <!-- Sorted eviction policy. -->
        <bean class="org.apache.ignite.cache.eviction.sorted.SortedEvictionPolicy">
            <!-- Set the maximum cache size to 1 million (default is 100,000) and use default comparator. -->
            <property name="maxSize" value="1000000"/>
        </bean>
    </property>
    ...
</bean>

Is your cache a single ignite node or is it clustered ? If clustered -- then you data will be distributed fairly evenly across all nodes such that if you configured 1G on 2 nodes you actually have a 2G distributed cache. 

Is your cache backed by any kind of persistence layer such that on a cache miss, it is restored from persistence ? 

Regards, 


Greg Patnude


Nordstrom IT/EI - Engineer III
Enterprise Events Engine
E-Mail: greg.patnude@nordstorm.com
Phone: (206) 233-5540
Cell: (253) 320-9751




-----Original Message-----
From: Seshu Pasam [mailto:ignite@pasam.com] 
Sent: Thursday, December 24, 2015 8:42 AM
To: user@ignite.apache.org
Subject: Eviction for OFFHEAP_TIERED vs OFFHEAP_VALUES

I am trying to use OFFHEAP_VALUES with offHeapMaxMemory (1G). I configured LRU eviction with maxMemorySize set to 1G (same as offHeapMaxMemory). When I put a large number of entries in the cache, I expected offHeap entries to get evicted. But it seems like offHeap is growing beyond configured limit (1G).

I am not interested in using swap space. This seems to work fine with OFFHEAP_TIERED. Is this a bug or known issue?

Thanks
-Seshu

Version: 1.5.0b1
Configuration:
                <bean
class="org.apache.ignite.configuration.CacheConfiguration"
                    p:offHeapMaxMemory="#{1 * 1024L * 1024L * 1024L}"
                    p:cacheMode="PARTITIONED"
                    p:memoryMode="OFFHEAP_TIERED"
                    p:swapEnabled="false"
...
                    <property name="evictionPolicy">
                        <bean
class="org.apache.ignite.cache.eviction.lru.LruEvictionPolicy"
                            p:maxMemorySize="#{1 * 1024L * 1024L * 1024L}"/>
                    </property>
                </bean>



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Eviction-for-OFFHEAP-TIERED-vs-OFFHEAP-VALUES-tp2302.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.