You’re creating a new cache on each heath check call and never destroy them – of course, that leads to a memory leak; it’s also awful for the performance.
Don’t create a new cache each time. If you really want to check that cache operations work, use the same one every time. Thanks, Stan From: Jason.G Sent: 10 октября 2018 г. 8:49 To: user@ignite.apache.org Subject: Re: Determine Node Health? Hi vgrigorev, I used your suggestion to do health check for each node. But I got memory leak issue and exit with OOM error: java heap space. Below is my example code: // I create one bean to collect what I want info which include IP, hostname, createtime and then return json string. IgniteHealthCheckEntity healthCheck = new IgniteHealthCheckEntity(); ClusterNode node = ignite.cluster().localNode(); List<String> adresses = (List<String>)node.addresses(); String ip = adresses.get(0); List<String> hostnames = (List<String>)node.hostNames(); String hostname = hostnames.get(0); healthCheck.setServerIp(ip); healthCheck.setStatus(0); healthCheck.setServerHostname(hostname); healthCheck.setMonitorTime(monitorTime); healthCheck.setClientIp(clientIp); String cacheName = "test_monitor_" + ipStr + "_"+ new Date().getTime(); IgniteCache<String, String> putCache = ignite.createCache(cacheName); putCache.put("test", "test"); String value = putCache.get("test"); if(!"test".equals(value)) { message = "Ignite ("+ ip +") " + "get/put value failed"; healthCheck.setMessage(message); return JSONObject.fromObject(healthCheck).toString(); }else { message = "OKOKOK"; healthCheck.setMessage(message); return JSONObject.fromObject(healthCheck).toString(); } -- Sent from: http://apache-ignite-users.70518.x6.nabble.com/