[ https://issues.apache.org/jira/browse/IGNITE-8775?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Yashasvi Kotamraju updated IGNITE-8775: --------------------------------------- Description: OutOfMemory Exception is observed when encountered with the issue IGNITE-8354. Though the issue is solved, preventing OOM by preventing unnecessary refresh of Cassandra session refresh, there seems to be a memory leak in In org.apache.ignite.cache.store.cassandra.session.CassandraSessionImpl.java when refresh() method is invoked to handle Exceptions, new Cluster is build with same LoadBalancingPolicy Object. We are using RoundRobinPolicy so same RoundRobinPolicy object would be used while building Cluster when refresh() is invoked. In RoundRobinPolicy there is a CopyOnWriteArrayList<Host> liveHosts. When ever init(Cluster cluster, Collection<Host> hosts) is called on RoundRobinPolicy it calls liveHosts.addAll(hosts) adding all the Host Object Collection to liveHosts. When ever Cluster is build during refresh() the Host Collection are added again to the liveHosts of the same RoundRobinPolicy that is used. Thus same Hosts are added again to liveHosts for every refresh() and the size would grow indefinitely after many refresh() calls causing OOM. Even in the heap dump post OOM we found huge number of Objects in liveHosts of RoundRobinPolicy Object. was: In org.apache.ignite.cache.store.cassandra.session.CassandraSessionImpl.java when refresh() method is invoked to handle Exceptions, new Cluster is build with same LoadBalancingPolicy Object. We are using RoundRobinPolicy so same RoundRobinPolicy object would be used while building Cluster when refresh() is invoked. In RoundRobinPolicy there is a CopyOnWriteArrayList<Host> liveHosts. When ever init(Cluster cluster, Collection<Host> hosts) is called on RoundRobinPolicy it calls liveHosts.addAll(hosts) adding all the Host Object Collection to liveHosts. When ever Cluster is build during refresh() the Host Collection are added again to the liveHosts of the same RoundRobinPolicy that is used. Thus same Hosts are added again to liveHosts for every refresh() and the size would grow indefinitely after many refresh() calls causing OOM. Even in the heap dump post OOM we found huge number of Objects in liveHosts of RoundRobinPolicy Object. > Memory leak in ignite-cassandra module while using RoundRobinPolicy > LoadBalancingPolicy > --------------------------------------------------------------------------------------- > > Key: IGNITE-8775 > URL: https://issues.apache.org/jira/browse/IGNITE-8775 > Project: Ignite > Issue Type: Bug > Components: cassandra > Reporter: Yashasvi Kotamraju > Priority: Major > > OutOfMemory Exception is observed when encountered with the issue > IGNITE-8354. Though the issue is solved, preventing OOM by preventing > unnecessary refresh of Cassandra session refresh, there seems to be a memory > leak in > In org.apache.ignite.cache.store.cassandra.session.CassandraSessionImpl.java > when refresh() method is invoked to handle Exceptions, new Cluster is build > with same LoadBalancingPolicy Object. We are using RoundRobinPolicy so same > RoundRobinPolicy object would be used while building Cluster when refresh() > is invoked. In RoundRobinPolicy there is a CopyOnWriteArrayList<Host> > liveHosts. When ever init(Cluster cluster, Collection<Host> hosts) is called > on RoundRobinPolicy it calls liveHosts.addAll(hosts) adding all the Host > Object Collection to liveHosts. > When ever Cluster is build during refresh() the Host Collection are added > again to the liveHosts of the same RoundRobinPolicy that is used. Thus same > Hosts are added again to liveHosts for every refresh() and the size would > grow indefinitely after many refresh() calls causing OOM. Even in the heap > dump post OOM we found huge number of Objects in liveHosts of > RoundRobinPolicy Object. > > -- This message was sent by Atlassian JIRA (v7.6.3#76005)