05-24-2005 01:42 AM
I am trying to profile simple Java applets. To get call graph, I used call graph wizard and chose java profiling next and set "appletviewer" as a program to launch. Finally as a java applet starting page, I typed in the "htm" file that calls the applet.
VTune runs and gives call graph but it is all about appletviewer and cannot find any information about my applet class. Can anybody help me?
05-26-2005 11:45 PM
Yes, that is correct. What you need to do is search for your class within the results (use Ctrl-F and search in the Function Summary). This is because your classes run within the context of the applet viewer.
Once you locate a function you are interested in, in the Function Summary, double-click on it and it will be displayed in the graph below. The statistics for the function will be displayed in the Function Summary and the tool tip displayed when you hover your mouse over the node in the graph.
05-27-2005 12:21 AM
Then would it be also possible to see J2ME MIDlet classes using VTune? In order to run J2ME MIDlet files, I run emulator from SUN wireless tool kit. It is a window program and executes MIDlet files on Java 2 Standard edition VM. I've tried this and emulator runs but there's no class files in the Function summary. I was using a profiler came with SUN WTK but it didn't give me information on threads. It will be great if I could know how many threads J2ME MIDlet generates and which ones are hotspots.
05-27-2005 04:35 PM
So, this will only work if 1) the emulator executes the standard JVM and 2) you can pass command line parameters to the JVM.
You see, when the VTune analyzer invokes the applet viewer, it passes a command line option to enable profiling to the JVM (you may have see -Xrunjavaperf:cg added to the command line). If you can get that to the JVM when run by the emulator, you should be able to see your class info. I'm not guarantee-ing anything, just saying that it should work if you can get the emulator to tell the JVM to do the right thing.