Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

The current usefulness of JMX is perhaps for viewing of resource depletion and concurrency issues such as thread deadlocking.

See also:
Jconsole improvements and extra options in 1.6
Dashboard article
Remote JVM profiling via SSH tunnels

Recipe

Enabling

For an insecure local test server in a well defended lab, to view live information from a test Sakai server, you may enable an open port locally via the following extra options in your start up script (see attachments).

...

  • If the server has a firewall, you will need to open access to port 1099 and the port range from 1099 (1024?) to 65535, as JConsole will make another incoming connection to the server on an unknown high-numbered port.
  • If the server's /etc/hosts file is not configured to return the correct IP address for the server's hostname (as revealed by hostname -i), you may need to correct this.

...

Code Block
java -jar cmdline-jmxclient-0.10.3.jar - localhost:3333  "java.lang:name=CMS Perm Gen,type=MemoryPool"  PeakUsage

EXAMPLE RESULT

Code Block

04/10/2007 12:08:01 +0200 org.archive.jmx.Client PeakUsage: 
committed: 268435456
init: 268435456
max: 268435456
used: 214605320

And a rather stupid script to convert the output into .csv format:

Code Block

#!/usr/bin/perl -w
my $file="permspace.log";
my ($date,$commited,$init,$max,$used,$newline)="";
open(TMP,$file)|| die "No file to open $file";
while($date=<TMP>){
	$commited=<TMP>;
	$init=<TMP>;
	$max=<TMP>;
	$used=<TMP>;
	$newline=<TMP>;
	my @temp=split(/ \+/,$date);
	my @temp2=split(/: /,$used);
	print "\"$temp[0]\",$temp2[1]";
}
close(TMP);

No doubt, it takes time to know which beans are relevant. I would suggest using jconsole.