Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 84223200CC7 for ; Sun, 2 Jul 2017 05:54:56 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 8228F160BF8; Sun, 2 Jul 2017 03:54:56 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id A3719160BEA for ; Sun, 2 Jul 2017 05:54:55 +0200 (CEST) Received: (qmail 60784 invoked by uid 500); 2 Jul 2017 03:54:54 -0000 Mailing-List: contact user-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@ignite.apache.org Delivered-To: mailing list user@ignite.apache.org Received: (qmail 60774 invoked by uid 99); 2 Jul 2017 03:54:54 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 02 Jul 2017 03:54:54 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id B83C6C660A for ; Sun, 2 Jul 2017 03:54:53 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.8 X-Spam-Level: * X-Spam-Status: No, score=1.8 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_NONE=-0.0001] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id GoeSCipeOji8 for ; Sun, 2 Jul 2017 03:54:52 +0000 (UTC) Received: from mwork.nabble.com (mwork.nabble.com [162.253.133.43]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 51A6C5F46F for ; Sun, 2 Jul 2017 03:54:52 +0000 (UTC) Received: from static.162.255.23.37.macminivault.com (unknown [162.255.23.37]) by mwork.nabble.com (Postfix) with ESMTP id 043654F1C3B8D for ; Sat, 1 Jul 2017 20:54:52 -0700 (MST) Date: Sat, 1 Jul 2017 20:54:52 -0700 (MST) From: Prashant312 To: user@ignite.apache.org Message-ID: <1498967692000-14228.post@n6.nabble.com> In-Reply-To: <1498856440543-14190.post@n6.nabble.com> References: <1498815972691-14175.post@n6.nabble.com> <1498846233147-14184.post@n6.nabble.com> <1498856440543-14190.post@n6.nabble.com> Subject: Re: Apache heap getting increase with cacheConfig.setCopyOnRead as false MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit archived-at: Sun, 02 Jul 2017 03:54:56 -0000 Hi, Please find below my code for creating and populating cache. ---- package ignite; import java.util.Arrays; import javax.cache.configuration.Factory; import org.apache.ignite.Ignite; import org.apache.ignite.IgniteCache; import org.apache.ignite.IgniteSystemProperties; import org.apache.ignite.Ignition; import org.apache.ignite.cache.CacheAtomicityMode; import org.apache.ignite.cache.CacheMode; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi; import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder; public class PopulateCache { public static IgniteCache igniteCache=null; public static void main(String[] args) { Ignition.setClientMode(false); System.setProperty(IgniteSystemProperties.IGNITE_QUIET,"false"); System.setProperty("java.net.preferIPv4Stack" , "true"); TcpDiscoverySpi spi = new TcpDiscoverySpi(); TcpDiscoveryVmIpFinder ipFinder = new TcpDiscoveryVmIpFinder(); ipFinder.setAddresses(Arrays.asList("localhost", "localhost:47500..47509")); spi.setIpFinder(ipFinder); IgniteConfiguration cfg = new IgniteConfiguration(); cfg.setDiscoverySpi(spi); Ignite ignite = Ignition.start(cfg); CacheConfiguration cacheConfig=new CacheConfiguration(); cacheConfig.setBackups(1); cacheConfig.setCopyOnRead(false); cacheConfig.setName("testCache"); cacheConfig.setCacheMode(CacheMode.PARTITIONED); igniteCache=ignite.getOrCreateCache(cacheConfig); igniteCache.put("100", "abc"); System.out.println("Done....cache"); } public static Object getCacheData(String key){ if(igniteCache!=null){ return igniteCache.get(key); } return key; } } ------------------------------------------------------- Log - / You can find that during creation of cache where we are putting just one value heap is 1.8 Gb. Topology snapshot [ver=1, servers=1, clients=0, CPUs=4, heap=1.8GB] / Now code for getting the cache is below ------------------------------------------------------ package ignite; import java.util.Arrays; import java.util.Properties; import org.apache.ignite.Ignite; import org.apache.ignite.IgniteCache; import org.apache.ignite.IgniteSystemProperties; import org.apache.ignite.Ignition; import org.apache.ignite.cache.CacheAtomicityMode; import org.apache.ignite.cache.CacheMode; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi; import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder; import static org.apache.ignite.IgniteSystemProperties.IGNITE_REST_START_ON_CLIENT; public class StartIgnite { public static IgniteCache igniteCache=null; public static void startIgnite(){ Ignition.setClientMode(true); System.setProperty(IgniteSystemProperties.IGNITE_QUIET,"false"); TcpDiscoverySpi spi = new TcpDiscoverySpi(); TcpDiscoveryVmIpFinder ipFinder = new TcpDiscoveryVmIpFinder(); ipFinder.setAddresses(Arrays.asList("localhost", "localhost:47500..47509")); spi.setIpFinder(ipFinder); System.out.println(ipFinder); IgniteConfiguration cfg = new IgniteConfiguration(); cfg.setDiscoverySpi(spi); Ignite ignite = Ignition.start(cfg); CacheConfiguration cacheConfig=new CacheConfiguration(); cacheConfig.setName("testCache"); cacheConfig.setCopyOnRead(false); //cacheConfig. //cacheConfig.s cacheConfig.setAtomicityMode(CacheAtomicityMode.ATOMIC); igniteCache=ignite.getOrCreateCache(cacheConfig); System.out.println("cache name is "+ igniteCache.getName()); } public static void stopIgnite(){ Ignition.stop(true); } public static String getCacheData(String id){ return igniteCache.get(id); } public static void main(String[] args) { startIgnite(); //System.out.println(Cache.getCacheData(CacheConstants.CLEANSING_TOKENS)); String obj=igniteCache.get("200"); String obj2=igniteCache.get("100"); System.out.println(obj); System.out.println(obj2); stopIgnite(); } } -------------------------------------------------- When we are executing above code heap gets increased to 3.5 GB. 09:22:55] Topology snapshot [ver=2, servers=1, clients=1, CPUs=4, heap=3.5GB] [09:22:57] Topology snapshot [ver=3, servers=1, clients=0, CPUs=4, heap=1.8GB] We want to avoid increase in heap size, in production we have cache of around 30 Gb and we are running the process parallel, causing heap size full. Thanks, Prashant -- View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Apache-heap-getting-increase-with-cacheConfig-setCopyOnRead-as-false-tp14175p14228.html Sent from the Apache Ignite Users mailing list archive at Nabble.com.