This week's post was written by Arv Fisher. Arv is the team leader of the Java development team in the IBM i development lab. Thanks, Arv!
Have you ever wanted to check the current garbage
collection (GC) heap size, check GC performance or display the parameters the
JVM was started with? If you have environments that use Java, these questions
as well as many others probably come to mind.
The IBM i 6.1 release has three new commands to assist in
answering your JVM environment and performance questions:
- Work With JVM Jobs (WRKJVMJOB)
- Print JVM Job (PRTJVMJOB)
- Generate JVM Dump (GENJVMDMP)
The new commands can be used on any job where an IBM
Technology for Java (IT4J) VM is currently running.
By default WRKJVMJOB will list all the currently active
JVMs regardless of how they were started. GC information, JVM arguments,
environment variables, thread information including Java thread names, the
capability to see the Java stack frames, native heap sizes and more are available
using WRKJVMJOB. (One thing that's really cool here is the environment
variables for the job-until WRKJVMJOB, there was no interface to easily display
the environment variables of a job other than your own! So WRKJVMJOB has some
interesting function beyond just working with JVMs!)
When JVM performance is being investigated, GC
information is a requirement. Most will validly choose not to run with verbose
GC enabled all the time, and having to restart the JVM just to enable verbose
GC isn't always an option. IBM i always keeps track of the last 300 GC cycles
for each IT4J JVM. Just use WRKJVMJOB to print the GC Cycle Table to a spool
file. The GC information in the spool file is in a somewhat readable form or
IBM Support Assistant (ISA) Version 4 can access IBM Monitoring and Diagnostic
Tools for Java -- Garbage Collection and Memory Visualizer (GCMV) -- to analyze the
GC information. If you have your own favorite tool that analyzes the
traditional verbose GC information you can specify -verbosegc on the Java
command line or just use WRKJVMJOB to enable or disable verbose GC at any time.
On IBM i, we allow you to collect GC information even when the JVM was not
started with verbose GC enabled.
Interested in performing an analysis of the Java objects
that exist in the GC heap? Use WRKJVMJOB to simplify the task. To perform an
in-depth heap analysis, you need to generate a heap dump. In the past on IBM i
and on other platforms, you had to start the JVM with some special Xdump
options, find the process identifier of the JVM and then issue a command that
looked like "kill -QUIT 5342". I know you were thinking the first
time you issued the command and probably still do today, "What were they
thinking?". On IBM i, we agreed and thought we can help. Without starting
up the JVM with any special options, use WRKJVMJOB to request any IT4J JVM to
generate a heap dump. We also have the capability to generate a Java or System
dump if you run into a situation where it's necessary. Once you have your heap
dump, you can use ISA Version 4 to get access to the tool Memory Dump
Diagnostic for Java (MDD4J) to analyze the GC heap. There are times when the
special Xdump options may be necessary. They still can be specified on the Java
command line as you would have done in the past. We have also provided an
option in WRKJVMJOB on the Work With JVM Jobs panel (12=Dump) to generate a
dump using the options specified on the Java command line.
WRKJOB also has a new option, 45, to invoke WRKJVMJOB if
that job has an active JVM. Experiment with WRKJVMJOB; you'll probably find
information that can be helpful and is readily available. Be sure to load the
latest Java Group PTF to get the most current version of the commands.
The new commands don't support the Classic JVM. IT4J will
be the only JVM supported in the follow-on release to 6.1. See the Upgrade
Planning Statement for the Java Developer Kit for additional information.
The complete list of options for WRKJVMJOB is available at the Information Center.
PRTJVMJOB allows you to target a specific JVM and lets
you directly print the information you can display under WRKJVMJOB. The
complete list of options for PRTJVMJOB is available at the Information Center.
GENJVMDMP allows you to target a specific JVM and request
it to generate a Java, System or Heap dump. The dump options are also available
under WRKJVMJOB. The complete list of GENJVMDMP options is available at the Info Center.
Additional information on ISA version 4 can be found at
the IBM Education Assistant Web site.




Arv, how do these new features, and the JVM work IBM is doing in general, compare to what other platforms have? Or more simply stated: What are the big reasons for choosing IBM i to run a java virtual machine on top of?
I look forward to your answer as this is one I don't know how to answer when I get asked, simply because by all appearances you would think that Java applications aren't really that integrated because of the JVM layer and thus don't capitalise as much on the nice integrated features we have in IBM i (i.e. DB2, work management, logging, etc)
Posted by: Aaron Bartell | September 01, 2009 at 06:48 AM
Aaron, just because Apple doesn't make every component in an iPhone doesn't make the iPhone less "Apple" or less "integrated" ... the Apple magic comes from the job that they do with the components that they pick. The same with the IBM i.
We ship the same IBM JVM on IBM i (IT4J) that is shipped on other platforms but on IBM i we have added some additional capabilities that are not available on other platforms or provide interfaces to make information much easier to attain.
* Provide a single interface to work with and manage all IT4J JVM's in your partition and allows real-time monitoring of your IT4J JVM's.
* Provide additional capability to gather and analyze GC information.
* Through wrkjob or wrkjvmjob you can see an integrated stack that includes Java frames, native frames and the OS frames.
* Propagate JVM error information into the joblog.
* Integrate IT4J JVM information into the IBM i Performance Explorer tools that allow you to analyze your IT4J performance as well as how it impacts the entire partition.
* Provide CPU usage, priority, Java thread name and other job related statistics through work management interfaces.
* Ability to display IT4J JVM start up options
* Ability to display the IT4J JVM environment variables.
* Integration with the IBM Toolbox
* Integration with RPG
Is it POSSIBLE to do most of the list on other platforms? Sure, but YOU download the right level of tooling, put it in the right directory, set the right environment variables or command line options -- YOU do the integration. On IBM i we dot the i's and cross the t's on testing, upgrades, PTFs. We are a one-stop place to call. We believe that is still where the value is.
Posted by: Arv Fisher | September 03, 2009 at 01:45 PM
Hi Dawn, I'm glad to access your blog for system i. May I ask you one question about SNA for system i? Does system i support SNA? If not, how do you access zSeries?
Thanks for your help.
regards,
Carl
Posted by: www.facebook.com/profile.php?id=1833537854 | October 12, 2009 at 03:56 AM
Carl,
Regarding your question on SNA - yes, IBM i does indeed support SNA. You can read about our communications support in the Information Center at http://publib.boulder.ibm.com/infocenter/iseries/v6r1m0/topic/rzahg/rzahg400comm.htm.
The question of SNA support comes up from time and time, and I plan to write a blog entry on it sometime in the future.
Posted by: Dawn | October 12, 2009 at 01:22 PM
Dawn,thanks your reply. we accesee to zSeries by SNUF over SNA with 2838 (10/100 Ethernet card). I know the v6r1 Giga Ethernet card doesn't support SNA. If we can't use SNUF access to zSeries in V6R1 or not ?
Hope your help.
regard,
Carl
Posted by: www.facebook.com/profile.php?id=1833537854 | October 13, 2009 at 01:44 AM
Hi, quick question:How do I move lincurfaseflibger_client.so and libjbedvm.so in system / lib and Jbed.apk in system / app ?Whenever I try it, I get a message that "You cannot paste here because the file system is read only"However, I installed Jbed.apk and it's not able to start. OI File Manager cannot start either (they probably need the files mentioned above).Thank you for any help
Posted by: Noy | October 06, 2012 at 03:51 AM