Hello,
There is a script names twiddle.sh which is present in the $JBOSS_HOME/bin directory (JBOSS_HOME : is the root directory of JBoss)
I am using the script for getting the Heap size and the Free and used memory along with the Active
Thread Counts in the following manner :
./twiddle.sh --server=jnp://$HOST:$PORT get "jboss.system:type=ServerInfo" FreeMemory | grep FreeMemory
./twiddle.sh --server=jnp://$HOST:$PORT get "jboss.system:type=ServerInfo" MaxMemory | grep MaxMemory
./twiddle.sh --server=jnp://$HOST:$PORT get "jboss.system:type=ServerInfo" ActiveThreadCount | grep ActiveThreadCount
The PORT here is the RMI port which is 1099 by default.