Google
 
Web unafbapune.blogspot.com

Thursday, August 03, 2006

 

Enable Remote Debugging + JMX, etc. from Ant

Sample configuration:
  <target name="mytarget">
<java classname="my.packagename.MyMainClassName"
fork="yes"
>
<!-- For remote debugging -->
<sysproperty key="DEBUG" value="true" />
<jvmarg value="-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000" />
<!-- For enabling JMX monitoring -->
<sysproperty key="com.sun.management.jmxremote.port" value="8001" />
<sysproperty key="com.sun.management.jmxremote.authenticate" value="false" />
<sysproperty key="com.sun.management.jmxremote.ssl" value="false" />
<!-- GC tuning. -->
<jvmarg value="-verbose:gc" />
<jvmarg value="-server" />
<jvmarg value="-XX:+UseParallelGC" />
<jvmarg value="-XX:GCTimeRatio=19" />
<!-- Heap tuning. -->
<jvmarg value="-Xms512m" />
<jvmarg value="-Xmx512m" />
<!-- JNI -->
<env key="LD_LIBRARY_PATH" value="/my/so/directory" />
<!-- Arguments, if any -->
<arg value="my.argument"/>
</java>
<classpath>
<pathelement path="${sample.dir}"/>
<path refid="sample.classpath"/>
</classpath>
</target>
Nice resource for setting up Remote Debugging for Java.
Nice articles on tuning GC can be found here, here and here.
Java Ant Task here.

Comments: Post a Comment

<< Home

This page is powered by Blogger. Isn't yours?