I have a simple thread that monitor remote wildfly process status. After some time client fails. Wildfly server also eat all memory and reports about connection errors. Some times wildfly also fails with fails with OutOfMemory exception.
Client code:
package ru.kamis.tests.xniomemoryleaks; import org.jboss.as.controller.client.ModelControllerClient; import org.jboss.as.controller.client.helpers.Operations; import org.jboss.dmr.ModelNode; public class OutOfMemoryDemo { public static void main(String[] args) throws Exception { for(int i=0; i<1000000; i++) { ModelControllerClient client = null; client = ModelControllerClient.Factory.create("localhost", 9990); ModelNode operation = Operations.createReadAttributeOperation(new ModelNode().setEmptyList(), "server-state"); client.execute(operation); client.close(); if(i % 1000 == 0) { System.out.println("Processed: " + i); } } } }
Client output:
июн 05, 2015 11:21:51 AM org.xnio.Xnio <clinit> INFO: XNIO version 3.2.0.Final июн 05, 2015 11:21:51 AM org.xnio.nio.NioXnio <clinit> INFO: XNIO NIO Implementation Version 3.3.0.Final июн 05, 2015 11:21:51 AM org.jboss.remoting3.EndpointImpl <clinit> INFO: JBoss Remoting version 4.0.6.Final Processed: 0 Processed: 1000 Processed: 2000 Processed: 3000 Processed: 4000 Processed: 5000 Exception in thread "main" java.io.IOException: java.net.ConnectException: JBAS012144: Could not connect to http-remoting://localhost:9990. The connection timed out at org.jboss.as.controller.client.impl.AbstractModelControllerClient.executeForResult(AbstractModelControllerClient.java:129) at org.jboss.as.controller.client.impl.AbstractModelControllerClient.execute(AbstractModelControllerClient.java:71) at ru.kamis.tests.xniomemoryleaks.OutOfMemoryDemo.main(OutOfMemoryDemo.java:12) Caused by: java.net.ConnectException: JBAS012144: Could not connect to http-remoting://localhost:9990. The connection timed out at org.jboss.as.protocol.ProtocolConnectionUtils.connectSync(ProtocolConnectionUtils.java:119) at org.jboss.as.protocol.ProtocolConnectionManager$EstablishingConnection.connect(ProtocolConnectionManager.java:256) at org.jboss.as.protocol.ProtocolConnectionManager.connect(ProtocolConnectionManager.java:70) at org.jboss.as.protocol.mgmt.FutureManagementChannel$Establishing.getChannel(FutureManagementChannel.java:204) at org.jboss.as.controller.client.impl.RemotingModelControllerClient.getOrCreateChannel(RemotingModelControllerClient.java:148) at org.jboss.as.controller.client.impl.RemotingModelControllerClient$1.getChannel(RemotingModelControllerClient.java:67) at org.jboss.as.protocol.mgmt.ManagementChannelHandler.executeRequest(ManagementChannelHandler.java:117) at org.jboss.as.protocol.mgmt.ManagementChannelHandler.executeRequest(ManagementChannelHandler.java:92) at org.jboss.as.controller.client.impl.AbstractModelControllerClient.executeRequest(AbstractModelControllerClient.java:236) at org.jboss.as.controller.client.impl.AbstractModelControllerClient.execute(AbstractModelControllerClient.java:141) at org.jboss.as.controller.client.impl.AbstractModelControllerClient.executeForResult(AbstractModelControllerClient.java:127) ... 2 more
Client libraries:
<dependency> <groupId>org.wildfly</groupId> <artifactId>wildfly-controller-client</artifactId> <version>8.2.0.Final</version> </dependency> <dependency> <groupId>org.jboss.remoting</groupId> <artifactId>jboss-remoting</artifactId> <version>4.0.6.Final</version> </dependency>
Project to reproduce error:
https://github.com/lis0x90/jboss-remoting-momory-leak-reproduce
Wildfly logs:
... 2015-06-05 11:21:10,195 DEBUG [org.jboss.as.config] (MSC service thread 1-6) VM Arguments: -Dprogram.name=standalone.bat -Xms64M -Xmx512M -XX:MaxPermSize=256M -Djboss.remoting.leakdebugging=true -Duser.country=RU -Duser.language=en -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Dorg.jboss.boot.log.file=H:\java\wildfly-8.2.0.Final\standalone\log\server.log -Dlogging.configuration=file:H:\java\wildfly-8.2.0.Final\standalone\configuration/logging.properties ... 2015-06-05 11:21:11,923 INFO [org.jboss.as] (Controller Boot Thread) JBAS015874: WildFly 8.2.0.Final "Tweek" started in 2259ms - Started 194 of 246 services (86 services are lazy, passive or on-demand) 2015-06-05 11:22:51,726 ERROR [org.jboss.remoting.remote.connection] (XNIO-1 I/O-2) JBREM000200: Remote connection failed: java.io.IOException: Программа на вашем хост-компьютере разорвала установленное подключение 2015-06-05 11:23:59,306 ERROR [org.jboss.remoting.remote.connection] (XNIO-1 I/O-1) JBREM000200: Remote connection failed: java.io.IOException: Программа на вашем хост-компьютере разорвала установленное подключение 2015-06-05 11:24:02,527 ERROR [org.jboss.remoting.remote.connection] (XNIO-1 I/O-1) JBREM000200: Remote connection failed: java.io.IOException: Программа на вашем хост-компьютере разорвала установленное подключение 2015-06-05 11:24:16,142 ERROR [org.jboss.remoting.remote.connection] (XNIO-1 I/O-2) JBREM000200: Remote connection failed: java.io.IOException: Программа на вашем хост-компьютере разорвала установленное подключение 2015-06-05 11:24:21,312 ERROR [org.jboss.remoting.remote.connection] (XNIO-1 I/O-1) JBREM000200: Remote connection failed: java.io.IOException: Программа на вашем хост-компьютере разорвала установленное подключение 2015-06-05 11:24:27,458 ERROR [org.jboss.remoting.remote.connection] (XNIO-1 I/O-2) JBREM000200: Remote connection failed: java.io.IOException: Программа на вашем хост-компьютере разорвала установленное подключение