Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Profiling Problems in 4.4 Squiggly
In order to keep to the minimal install we are using the IAC binaries This is the minimal script used to start the application
set TPTP_AC_HOME=D:\IDEs\4403\eclipse\plugins\org.eclipse.tptp.platform.ac.win_ia32_4.4.1.v200709261752\agent_controller
set JAVA_PROFILER_HOME=D:\IDEs\4403\eclipse\plugins\org.eclipse.tptp.platform.jvmti.runtime_4.4.1.v200709261752\agent_files\win_ia32
set PATH=%PATH%;%JAVA_PROFILER_HOME%;%TPTP_AC_HOME%\bin
set JVM=C:\WINDOWS\system32/java.exe
set AGENT=-agentlib:JPIBootLoader=JPIAgent:server=enabled;CGProf:execdetails=true
set PARMS=
set CLASSPATH=.
%JVM% %AGENT% %PARMS% -jar batik-squiggle.jar
The first problem is that came up
Could not start Agent Controller.
Empty serviceconfig.xml file
Make sure you have created a valid serviceconfig.xml file by running the SetConfig script.
The file appears to exist but is empty. Note that this Eclipse instance has been used in the past to profile using IAC as an embedded component.
When attempting to run setconfig this message is returned
ERROR: The Java Runtime in use does not contain a suitable JAXP feature
RESOLUTION: Use a JRE which supports the JAXP feature
This occurs because the JRE being used is a SUN 1.6 release.
Bottom line is that there are several things I need to figure out before I can start and profile this application.
Contents
time to backup a bit
Because I know too much, I realized I may be able to get around the setconfig problems by starting the workbench and IAC before starting squiggle. So I did. I started the workbench and created an agent attach profile, and then started squiggle with the above script, and it still did not start, indicating the IAC was not yet running. So I went into the profiling session and "tested" the connection and tried squiggle again. This time squiggle sloooowly started.
Before trying anything I attached to the agent and used the default filters. In this case the default was not a good idea, because it excluded org* which would include org.apache.batik. Attach seems to work, and the navigator kept showing "monitoring". I then clicked a few buttons in squiggle, and nothing showed up in the profiling sessions, so I reopened the views and now there was was some class statistics of classes that should have been filtered out. There were execution statistics which where initially zero, but the other views showed no data.
So I looked at the node properties to check the filters. I saw a filter set called __JVMPI__ (versus Default) and removed the org* exclude. Used squiggle a few more times but no new data.
I disconnected from the agent, started a new connection with the filters I wanted, and attached. This time no data at all ever came to the views. Even after opening and closing them. So I disconnected from the agent again, and deleted the to connections. I was left with a the status at the bottom switching between 1788264 events processed and 0 event processed. This was the status of the to previous connections.
I restarted squiggle with the same options again and then attached with the filters I needed to not exclude batik, and then tried squiggle. Now I was getting data in the execution statistics view including methods in the summary. If I select call tree there are two entries with no children. If I select either of the method tabs, there is no data. Execution flow viewers seems to have a line for each thread but only a numbered method in the table view. A double click on the method give a null pointer exception. UML interaction diagrams say there is no data.
I am in a state where I can work around the connection problem but still do not get any meaningful results. I believe I have come across a large number of bugs to get this far.
Observations when trying jvmpi
Using the following script to point to a 1.4 jre I ran squiggle
set TPTP_AC_HOME=D:\IDEs\4403\eclipse\plugins\org.eclipse.tptp.platform.ac.win_ia32_4.4.1.v200709261752\agent_controller
set JAVA_PROFILER_HOME=D:\IDEs\4403\eclipse\plugins\org.eclipse.tptp.platform.jvmti.runtime_4.4.1.v200709261752\agent_files\win_ia32
set JAVA_HOME=d:\java14\bin
set JVM=%JAVA_HOME%\java.exe
set PATH=%JAVA_HOME%;%JAVA_PROFILER_HOME%;%TPTP_AC_HOME%\bin;%PATH%
set AGENT=-XrunpiAgent:server=enabled
set PARMS=
set CLASSPATH=.
%JVM% %AGENT% %PARMS% -jar batik-squiggle.jar
Without having started a workbench and therefor not having the IAC started I get a different result.
D:\batik\batik-1.7>d:\java14\bin\java.exe -XrunpiAgent:server=enabled -jar batik-squiggle.jar
Agent Controller is not active: will wait in a 1000 ms loop
Note that because I had run things once as noted above the serverconfig file was already set up, hoever in this case the lack of a running AC didn't not hold me up. When I started the workbench, I attached to the pi agent with no problems and once collecting, all the views were populated and the method links did not give an NPE.
Second try from scratch, with better results
I tried this all again with a better understanding of the capabilities provided by Eclipse and TPTP. The various things needed to set up and run using scripts simply seem too tedious and are not typically required by commercial tools. Even with the various suggested workaround, I was still getting variable behavior. It turns out that not all profiling types are supported in the attach scenario and this was another part of my problem. So I use Eclipse more as it was intended.
The good news
For the Batik profiling, I simply used the Eclipse "Run" action for an external Java application. I set the class name to "org/apache/batik/apps/svgbrowser/Main" and the classpath to "D:\batik\batik-1.7\batik-squiggle.jar;D:\batik\batik-1.7;D:\batik\batik-1.7\lib". When doing this via the profile action I set the monitor tab for execution time analysis and set the filters as needed. When I selected run, squiggle came up and ran. When I selected profile it took a while due to the applying of instrumentation, but it also came up and ran. This is the same as running in "controlled mode" had i used scripts and attached. So the need for scripts to profile squiggle is unnecessary.
For the tomcat scenario, I used the WTP extensions. First I created a "server" and configured it to be my version of tomcat (5.5) and I could successfully run the server, although there were no applications running. By double clicking the server when it is stopped, I could edit the properties and selected the server location to be the server install "take control of the server". The next time I started the server it had all the default applications running and I could run my squiggle and jsp example.
To profile the server I simply selected the server and the profile action, and was then prompted to set profiling type and the filters. This then brought up the server and I was all set.
Now from the workbench I could launch and run both applications, and did not require attach support to get to this point. This is good progress, so now I can assess the stack time as originally intended.
The not so good news
I still have the basic profile on server problem. That is that until I trick the embedded agent controller to start it is not active. This is a bug that needs to be fixed asap.
Once I launched both applications as noted above, my use case was to see where time was spent when an SVG stream was created on the server and then rendered on the client (squiggle in this case). Because I started profiling at application start time, I already had data from both applications in the various profiling views and a needed a clean baseline. I noticed that the tabular views all supported and delta indicator at each refresh but refreshes where happening every few seconds, so this was useless to me until I saw that I could manually refresh. Once I did that I could control the delta but I could not see what the delta was so I was still not being helped. So I selected "unload profiling data" which did clear the views but after that no more data was seen in the views. This is another serious bug. Bugzilla bug 214098 bug 215027
At this point I tried various things to get a baseline including re-attaching to the agent etc.. I took the following note about problems I saw:
- tomcat had two execution time profiler both collecting what appears to be the same events, only one has the filter as defined and the other has no filters therefor star exclude an in both the name is _JVMPI_. The second has all unknown threads
- clear data and memory is not reduced but views do go empty (intention is to get a clean baseline from each agent)Bugzilla bug 215032
- trigger more events and nothing appears to be loaded
- detach and reattach new execution statistics agent is added bu the filter has no values and never loads any data, however the "terminated" agent toggles back and forth with monitoring and loads the data and populates the views
- detach the agent with no data and no more data is collected
reset the workbench by detaching and deleting all resources, and then attach to the exposed agents (works very nicely as a concept)
- no data is every loaded (filter has the right name but are out of order)
- only PID is shown where before squiggle had the right process name
terminate the server and squiggle at the application and the navigator shows both terminated. Delete all the things shown in the navigator, get the correct prompts and the navigator clears
- select the navigator and the status line at the bottom toggles between the status of the prior agents
with all resources deleted, and the profiling perspective closed, memory is still not released Bugzilla bug 215032
preferences select IAC and change security settings, after having used the IAC, get prompted to restart IAC, and the ACServer is stopped, but not started. AcSvc never goes away.
first view of execution statistics shows deltas (refresh set to 5 seconds)
- view associations don't allow any role up view
- no way to set buffer size in IAC - default of 24meg may be too small (need to look at Alex/igors fix)
- run squiggle with thread monitored, works nice but if window is partially hidden and and then a new uri set app hangs on AWT thread and app is hung