Return-Path: X-Original-To: apmail-ignite-issues-archive@minotaur.apache.org Delivered-To: apmail-ignite-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8CD1318C90 for ; Thu, 19 Nov 2015 13:24:11 +0000 (UTC) Received: (qmail 44560 invoked by uid 500); 19 Nov 2015 13:24:11 -0000 Delivered-To: apmail-ignite-issues-archive@ignite.apache.org Received: (qmail 44491 invoked by uid 500); 19 Nov 2015 13:24:11 -0000 Mailing-List: contact issues-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.apache.org Delivered-To: mailing list issues@ignite.apache.org Received: (qmail 44398 invoked by uid 99); 19 Nov 2015 13:24:11 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 19 Nov 2015 13:24:11 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 1673A2C1F70 for ; Thu, 19 Nov 2015 13:24:11 +0000 (UTC) Date: Thu, 19 Nov 2015 13:24:11 +0000 (UTC) From: "Yakov Zhdanov (JIRA)" To: issues@ignite.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (IGNITE-1895) Entries aren't evicted for LRU policy MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/IGNITE-1895?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15013524#comment-15013524 ] Yakov Zhdanov commented on IGNITE-1895: --------------------------------------- 50 is the max size per 1 server. If you have 3 servers the overall size may be up to 150. > Entries aren't evicted for LRU policy > ------------------------------------- > > Key: IGNITE-1895 > URL: https://issues.apache.org/jira/browse/IGNITE-1895 > Project: Ignite > Issue Type: Bug > Components: cache > Affects Versions: 1.5 > Reporter: Sergey Kozlov > Assignee: Sergey Kozlov > Fix For: 1.5 > > Attachments: example-ignite-lru-client.xml, example-ignite-lru.xml > > > 1. : > {code:title=CacheLruExample.java|borderStyle=solid} > package org.apache.ignite.examples.datagrid; > import java.util.HashMap; > import java.util.Map; > import org.apache.ignite.Ignite; > import org.apache.ignite.IgniteCache; > import org.apache.ignite.IgniteException; > import org.apache.ignite.Ignition; > import org.apache.ignite.examples.ExampleNodeStartup; > public class CachePutGetExample { > /** Cache name. */ > private static final String CACHE_NAME = "cache_0001"; > public static void main(String[] args) throws IgniteException, InterruptedException { > try (Ignite ignite = Ignition.start("examples/config/example-ignite-lru-client.xml")) { > try (IgniteCache cache = ignite.getOrCreateCache(CACHE_NAME)) { > System.out.println(); > System.out.println(">>> Test started."); > int counter = 0; > for (int i = 1; i <= 100; i++) { > if (cache.get(i) != null) > counter++; > } > System.out.println(">>> Get: found not-null keys " + Integer.toString(counter)); > Thread.sleep(1000); > for (int i = 1; i <= 100; i++) { > cache.remove(i); > } > System.out.println(">>> Remove: 1..100"); > Thread.sleep(1000); > counter = 0; > for (int i = 1; i <= 100; i++) { > cache.put(i, Integer.toString(i)); > counter++; > } > System.out.println(">>> Put: 1..100"); > Thread.sleep(1000); > counter = 0; > for (int i = 50; i <= 100; i++) { > if (cache.get(i) != null) > counter++; > } > System.out.println(">>> Get 50..100"); > Thread.sleep(1000); > for (int i = 30; i <= 49; i++) { > cache.put(i, Integer.toString(i)); > } > System.out.println(">>> Put: 30..49"); > Thread.sleep(1000); > counter = 0; > for (int i = 1; i <= 100; i++) { > if (cache.get(i) != null) > counter++; > } > System.out.println(">>> Get: found not-null keys (must be 50): " + Integer.toString(counter)); > } > } > } > } > {code} > 2. Copy attached configurations in examples/config directory > 3. Start two nodes with example-ignite-lru.xml > 3. Compile and run example > 4. The output of example shows that cache has more entries than defined by max size in eviction policy: > {noformat} > ... > [16:34:47,088][INFO ][main][GridDiscoveryManager] Topology snapshot [ver=3, servers=2, clients=1, CPUs=8, heap=3.8GB] > >>> Test started. > >>> Get: found not-null keys 0 > >>> Remove: 1..100 > >>> Put: 1..100 > >>> Get 50..100 > >>> Put: 30..49 > >>> Get: found not-null keys (must be 50): 70 > ... > {noformat} -- This message was sent by Atlassian JIRA (v6.3.4#6332)