ignite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pavel Tupitsyn (JIRA)" <j...@apache.org>
Subject [jira] [Created] (IGNITE-2417) peerClassLoading causes high memory usage on simple cache operations
Date Wed, 20 Jan 2016 12:35:39 GMT
Pavel Tupitsyn created IGNITE-2417:

             Summary: peerClassLoading causes high memory usage on simple cache operations
                 Key: IGNITE-2417
                 URL: https://issues.apache.org/jira/browse/IGNITE-2417
             Project: Ignite
          Issue Type: Bug
          Components: cache
    Affects Versions: 1.1.4
            Reporter: Pavel Tupitsyn
            Priority: Critical
             Fix For: 1.6

Issue surfaced in .NET, but this code can be easily ported to Java. Only one node is started.

Without peerClassLoading, Java heap usage is aroung 2GB with this code. With peerClassLoading,
heap goes to the max and then there is OutOfMemoryException.

var cfg = new GridConfiguration
    SpringConfigUrl = @"example-cache.xml",
    JvmOptions = new List<string> { "-Xms1024m", "-Xmx8192m" },

using (var grid = GridFactory.Start(cfg))
    var cache = grid.GetOrCreateCache<object, object>("cache_put_get");
    var obj = string.Join("", Enumerable.Range(0, 5 * 1024));

    const int iterations = 100 * 1000;
    for (var i = 0; i < iterations; i++)
        cache.Put(i.ToString(), obj);

Config file:
<beans xmlns="http://www.springframework.org/schema/beans"
    <bean id="grid.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
        <property name="peerClassLoadingEnabled" value="true"/>
		<property name="discoverySpi">
            <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
                <property name="ipFinder">
                    <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder">
                        <property name="addresses">
                                <!-- In distributed environment, replace with actual host
IP address. -->

This message was sent by Atlassian JIRA

View raw message