JVM args

10 down vote accepted
RuntimeMXBean RuntimemxBean = ManagementFactory.getRuntimeMXBean(); 
List<String> aList=RuntimemxBean.getInputArguments(); 
 
for(int i=0;i<aList.size();i++) { 
   
System.out.println(aList.get(i)); } 

should be enough to get you any JVM parameter value.

Note: we do not have JVM parameter in VCS either, but in a database, read by our own launchers in productions. That way, we can change those values remotely, without having to redeploy JVM parameter file settings.


 

You will find a good sumary of various JVM tools to use in this article (from the "Dustin's Software Development Cogitations and Speculations"), including Java Application Launcher links to :

This technique takes advantage of Platform MXBeans available since J2SE 5 (custom MXBeans support was added in Java SE 6).

Two useful sources of information on the JVM parameters available when using Sun's JVM are:

Both of these resources list and describe some/all of the not-recommended-for-the-casual-developer double X arguments (-XX) that are available.

http://download.oracle.com/javase/6/docs/technotes/guides/management/mxbeans.html
posted @ 2011-09-16 23:32  规格严格-功夫到家  阅读(686)  评论(0编辑  收藏  举报