ignite-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexei Scherbakov (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (IGNITE-2417) peerClassLoading causes high memory usage on simple cache operations
Date Thu, 01 Sep 2016 16:11:20 GMT

    [ https://issues.apache.org/jira/browse/IGNITE-2417?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15455882#comment-15455882
] 

Alexei Scherbakov commented on IGNITE-2417:
-------------------------------------------

I've stumbled upon this issue as well.

See the test in the attachment. Recommended heap size 1500m.

I've run it in different configurations and see the following results:

1. With BinaryMarshaller, peerClassLoadingEnabled=false, copyOnRead=true, after writing used
heap ~500M of RAM, after reading 500M
This is the expected behavior.

2. With BinaryMarshaller, peerClassLoadingEnabled=false, copyOnRead=false, after writing used
heap ~500M of RAM, after reading 1G

3. With BinaryMarshaller, peerClassLoadingEnabled=true,  copyOnRead=any, after writing used
heap ~500M of RAM, after reading 1G

4. With BinaryMarshaller, peerClassLoadingEnabled=any,  copyOnRead=any,  enabled events, after
writing used heap ~1G of RAM, after reading 1G

5. With OptimizedMarshaller, peerClassLoadingEnabled=any, after writing used heap ~1G of RAM,
after reading 1G

Moreover, I got OOM running two tests in a sequence with enabled events despite of calling
destroyCache between.


> 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: Blocker
>              Labels: performance
>             Fix For: 1.8
>
>
> 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.
> {code}
> 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");
>     cache.Clear();
>     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);
> }
> {code}
> Config file:
> {code}
> <beans xmlns="http://www.springframework.org/schema/beans"
>        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>        xmlns:util="http://www.springframework.org/schema/util"
>        xsi:schemaLocation="
>         http://www.springframework.org/schema/beans
>         http://www.springframework.org/schema/beans/spring-beans.xsd
>         http://www.springframework.org/schema/util
>         http://www.springframework.org/schema/util/spring-util.xsd">
>     <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">
>                             <list>
>                                 <!-- In distributed environment, replace with actual
host IP address. -->
>                                 <value>127.0.0.1:47500..47501</value>
>                             </list>
>                         </property>
>                     </bean>
>                 </property>
>             </bean>
>         </property>
>     </bean>
> </beans>
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message