http://www.jotschi.de/Uncategorized/2009/01/26/remote-monitoring-heap-memory-usage-using-jmx-rmi.html

Shows how to write simple Java JMX RMI client to extract RMI values.