Hazelcast内存泄漏

时间:2018-07-10 14:57:52

标签: hazelcast

使用hazelcast IAtomic集群逻辑时遇到了一个问题。我的配置就像我有4个节点,第一个节点是hazelcast的主节点。如果第一个节点将关闭,则第二个节点将是主节点。 场景步骤是:

  1. 我同时杀死了第一个节点和第三个节点
  2. Hazelcast由于主节点死亡而决定选择一个新的主节点。新的主节点是2nd Node。
  3. 第2节点尝试进行迁移,由于Hazelcast,在这里,系统将内存不足。 Hazelcast正在尝试再次连接第三个节点(如无限循环)。最终将没有内存,并且系统不会抛出 OutOfMemoryException

下面的Hazelcast日志

    Jul 10, 2018 2:52:36 PM com.hazelcast.nio.tcp.TcpIpConnection
INFO: [198.168.10.11]:5702 [dev] [3.10.2] Connection[id=21282, /198.168.10.14:50491->/198.168.10.14:5702, endpoint=[198.168.10.14]:5702, alive=false, type=MEMBER] closed. Reason: Connection closed by the other side
Jul 10, 2018 2:52:36 PM com.hazelcast.nio.tcp.TcpIpConnector
INFO: [198.168.10.11]:5702 [dev] [3.10.2] Connecting to /198.168.10.14:5702, timeout: 0, bind-any: true
Jul 10, 2018 2:52:36 PM com.hazelcast.nio.tcp.TcpIpAcceptor
INFO: [198.168.10.11]:5702 [dev] [3.10.2] Accepting socket connection from /198.168.10.14:56774
Jul 10, 2018 2:52:36 PM com.hazelcast.nio.tcp.TcpIpConnectionManager
INFO: [198.168.10.11]:5702 [dev] [3.10.2] Established socket connection between /198.168.10.14:5702 and /198.168.10.14:56774
Jul 10, 2018 2:52:36 PM com.hazelcast.nio.tcp.TcpIpConnectionManager
INFO: [198.168.10.11]:5702 [dev] [3.10.2] Established socket connection between /198.168.10.14:56774 and /198.168.10.14:5702
Jul 10, 2018 2:52:36 PM com.hazelcast.nio.tcp.TcpIpConnectionManager
WARNING: [198.168.10.11]:5702 [dev] [3.10.2] Wrong bind request from [198.168.10.11]:5701! This node is not the requested endpoint: [198.168.10.14]:5702
Jul 10, 2018 2:52:36 PM com.hazelcast.nio.tcp.TcpIpConnection
INFO: [198.168.10.11]:5702 [dev] [3.10.2] Connection[id=21284, /198.168.10.14:5702->/198.168.10.14:55083, endpoint=null, alive=false, type=MEMBER] closed. Reason: Wrong bind request from [198.168.10.11]:5701! This node is not the requested endpoint: [198.168.10.14]:5702
Jul 10, 2018 2:52:36 PM com.hazelcast.nio.tcp.TcpIpAcceptor
INFO: [198.168.10.11]:5702 [dev] [3.10.2] Accepting socket connection from /198.168.10.14:51198
Jul 10, 2018 2:52:36 PM com.hazelcast.nio.tcp.TcpIpConnectionManager
INFO: [198.168.10.11]:5702 [dev] [3.10.2] Established socket connection between /198.168.10.14:5702 and /198.168.10.14:51198
Jul 10, 2018 2:52:36 PM com.hazelcast.nio.tcp.TcpIpConnectionManager
WARNING: [198.168.10.11]:5702 [dev] [3.10.2] Wrong bind request from [198.168.10.11]:5701! This node is not the requested endpoint: [198.168.10.14]:5702
Jul 10, 2018 2:52:36 PM com.hazelcast.nio.tcp.TcpIpConnection

节点1和节点3在运行同一服务器上。 节点2和节点4在同一台服务器上运行

(用于初始化hazelcast的)配置为:

Config config = new Config();
    NetworkConfig network = config.getNetworkConfig();
    JoinConfig join = network.getJoin();
    join.getMulticastConfig().setEnabled(true);
    join.getTcpIpConfig().setEnabled(false);

    config.setNetworkConfig(network);
    config.setInstanceName("instance");

1 个答案:

答案 0 :(得分:0)

当我得到堆转储时。我使用MAT进行分析,结果是: MAT result

MAT Result