Posts Tagged ‘jvm’

How to connect jconsole to a remote tomcat on a linux machine resolving connection refused issue

Follow these steps:

open the jmx port on the tomcat jvm

fill the (under TOMCAT-HOME/bin) with the following parameters


It’s important to use CATALINA_OPTS and not JAVA_OPTS to resolve tomcat shutdown issue

On linux it’s likely to have a connection refused issue.

So start jconsole in debugging mode (jconsole -debug from a terminal). If you see a local (from server point of view) ip (e.g. you must go on server, type hostname -i and see how the hostname it’s resolved by the server (e.g. Then you must change the row of etc/hosts file where the server hostname is translated into the local ip ( You can delete the row and use the DNS or insert the server ip.


Categories: Uncategorized Tags: , , ,

How to resolve out of memory errors during maven test phase

November 5, 2012 Leave a comment

Sometimes during maven test phase, jvm out of memory errors occur. It must know that maven tests, are executed in a forked jvm (this for default).
So if you launch maven with the usual parameters -Xmx512M -XX:MaxPermSize=512M etc. etc. these will not propagated to the forked test jvm.
The solution is to use this parameter: -Dmaven.surefire.debug.

So if you want increase the memory used during the test execution, you must use a command like this:
mvn -Dmaven.surefire.debug=”-server -Xmx512M -XX:MaxPermSize=512M” test
here I’ve used the “-server” parameter to force the jvm to use the parallel throughput gc, increasing the performance of the forked jvm about releasing memory.

The maven reference:

Categories: Uncategorized Tags: , , ,