Connecting to a controller via a new CommandContext always init a new console which could lead into "OutOfMemoryError: unable to create new native thread" as initBasicConsole() creates a pair of Aesh thread which are not cleaned up with terminateSession().
import org.jboss.as.cli.scriptsupport.CLI; CLI cli = CLI.newInstance(); for (int i = 1; i <= tries; i++) { cli.connect(); cli.disconnect(); }
Reproducer waits for 10s after every 50 connections, that's where the steps on the graph comes from:
Regression against 7.0.0.ER1 and 6.4.x
- is cloned by
-
WFCORE-1218 Connecting to controller via new CommandContext instance leak threads
- Resolved