About profiling Java applet performance from Jboss

Jboss is application service used in J2EE service field. Jboss is robust, high quality and with high performance. Jboss supports web servlets and JSP containers, html services, etc. Early Jboss uses Apach Tomcat Web service separately, but in recent version Apach-tomcat already has been integrated into Jboss. 

This article shows you how to use VTune™ Amplifier XE to profile Java applet. I used jboss-as-7.1.1 as example.

Here are steps:

1. Install JDK which includes JRE, required by Jboss running. I uses Java version 1.7.0_11, and you should set environment like as:

export JRE_HOME=/home/peter/jdk1.7.0_11/

2. Extract jboss-as-7.1.1 in any folder, actually Jboss don’t need to install, just self-extracting .

3. Start / stop Jboss standalone sever.

a) Jboss/standalone.sh &

b) In other console, you should see new java class by using ““ps -ae | grep java”, and run http://localhost:8080 in browser to see welcome page. 

c) If you want to stop Jboss server, do “Jboss/jboss-cli.sh --connect --command=:shutdown”

4. Simply copy an existing Java http servlet applet - wrapped in sample.war (which I used is from apache-tomcat-7.0.40 example).

5. In the console of Jboss standalone server, you will see  message looks like below. It is said “hot” deployments. 

10:19:22,614 INFO  [org.jboss.as] (MSC service thread 1-8) JBAS015951: Admin console listening on http://127.0.0.1:9990

10:19:22,615 INFO  [org.jboss.as] (MSC service thread 1-8) JBAS015874: JBoss AS 7.1.1.Final "Brontes" started in 1476ms - Started 174 of 251 services (76 services are passive or on-demand)

10:19:22,723 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS018559: Deployed "sample.war"

6. Now you can start any internet browser. Use http://localhost:8080/sample. It means your applet works on Jboss.

7. You can start VTune™ Amplifier XE to profile all active processes including Java performance in system wide, for example – "amplxe-cl -collect lightweight-hotspots -duration 60". Note that you cannot attach hot Java process like as I did in Apach-tomcat, see this article. Otherwise, the tool will say "...amplxe: Warning: Cannot profile the managed part of the target process. Internal error. Only native part of the target process will be profiled..."

8. Use VTune™ Amplifier XE GUI to open result.

For more complete information about compiler optimizations, see our Optimization Notice.