Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 197293

Summary: Starting server with JVMTI attached to standalone Agent Controller is very slow
Product: z_Archived Reporter: Mark Birenbaum <mark>
Component: TPTPAssignee: Bing Xu <xubing>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P1 CC: asaf.yaffe, igor.alelekov, jgwest, jkubasta
Version: unspecifiedKeywords: plan
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard: closed460

Description Mark Birenbaum CLA 2007-07-20 08:52:54 EDT
Build ID: TPTP-4.4.0.1-200707090100B

Steps To Reproduce:
I'm using:
-Sun JDK 6 on Windows XP.
-Running tomcat 5.5

1) I've installed the stand alone controller (4.4.0.1)
2)  My server (tomcat) is set up like this:
set JAVA_OPTS=%JAVA_OPTS% -agentlib:JPIBootLoader=JPIAgent:server=enabled;CGProf

3) Please note, I am not attempting to profile (i.e., I don't even have eclipse running), I'm just running my application.


More information:
When I attempt to start a stand alone java application it is dramatically slower than when starting it alone.  It's also slower than starting it using JVMPI to connect to the AC.

I was under the impression that using JVMTI should allow me to have nearly identical performance to a non-attached server (for any part of the application that wasn't being actively profiled).  

Starting my server without configuring it to connect to the AC takes about 70 seconds.  When trying to connect it to the stand-alone AC, it takes about 230 seconds.

When using JVMPI (with JDK 1.5) it took about 130 seconds to boot (although with JDK 1.5 it also took about 100 seconds to boot without connection to the AC)
Comment 1 jkubasta CLA 2007-08-20 19:49:56 EDT
Samson, would you please do the initial investigation?  See the 1.5 results as JVM 1.6 is not supported with 4.4.x
Comment 2 Mark Birenbaum CLA 2007-08-21 19:46:34 EDT
Mr. Wai, to avoid wasting your time, I'll run my test on 1.5 JVMTI (I'm pretty sure I did already, but don't remember for sure) and let you know one way or the other.
Comment 3 Mark Birenbaum CLA 2007-08-22 08:39:41 EDT
Confirmed I see this on JDK 1.5.

This time I tested by using a clean Tomcat configuration (without my server).

With JVMTI it took 4.96-5.01 seconds to start.
With JVMPI it takes 0.94-0.95 seconds to start.
With neither it takes 0.74-0.75 seconds to start.

I tested by starting up a default tomcat 5.5.20 installation, with all sample apps except "balancer" and "ROOT" removed.

My JVMPI settings:
set PATH=%PATH%;%TPTP_AGENT_CONTROLLER_HOME%;%TPTP_AGENT_CONTROLLER_HOME%\bin;%JAVA_PROFILER_HOME%

set JAVA_OPTS=%JAVA_OPTS% -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n 

My JVMTI settings:
set PATH=%JAVA_PROFILER_HOME%;%PATH%;%TPTP_AGENT_CONTROLLER_HOME%\bin;%JAVA_HOME%\bin
set JAVA_OPTS=%JAVA_OPTS% -agentlib:JPIBootLoader=JPIAgent:server=enabled;CGProf


------
Other settings (shared by both):
set TPTP_AGENT_CONTROLLER_HOME=c:\programs\agntctrl-tptp-4.4
set JAVA_PROFILER_HOME=%TPTP_AGENT_CONTROLLER_HOME%\plugins\org.eclipse.tptp.javaprofiler

Comment 4 Samson Wai CLA 2007-11-27 09:30:34 EST
Hi Bing. I have transferred my bugs to you for triage. Thanks.
Comment 5 Bing Xu CLA 2008-03-07 10:10:11 EST
Hi Igor, is this JVMTI related defect?
Comment 6 Asaf Yaffe CLA 2008-03-09 07:39:29 EDT
If I remember correctly, support for dynamic instrumentation in "enabled" mode in the JVMTI Profiler (which allows an application to run in full speed until the profiler attaches) was added only in 4.4.0.3.

Mark, can you please test the same scenarios with the latest 4.4.1 release version?

Thanks,
Asaf
Comment 7 Mark Birenbaum CLA 2008-03-10 09:56:53 EDT
I'm afraid it actually seems worse, any possibility
there's a configuration error on my part?

With TPTP 4.4.1.0
  JVMTI: 13.4-14.0 seconds
  JVMPI: 0.9 seconds
  Neither: 0.7 seconds

--------
My config:

set PATH=%JAVA_PROFILER_HOME%;%PATH%;%TPTP_AGENT_CONTROLLER_HOME%\bin;%JAVA_HOME%\bin

set JAVA_OPTS=%JAVA_OPTS% -agentlib:jdwp=transport=dt_socket,server=y,address=8000,suspend=n

set JAVA_OPTS=%JAVA_OPTS% -agentlib:JPIBootLoader=JPIAgent:server=enabled;CGProf
Comment 8 Mark Birenbaum CLA 2008-03-10 10:07:05 EDT
Doh... And of coruse there was a config error in my last one  I had an extraneous load of jdwp.  Yes, it's definitely much faster than before (although still significantly worse than JVMPI)

With TPTP 4.4.1
JVMTI: 1.83-1.84 seconds
JVMPI: 0.94 seconds
Neither: 0.73 seconds


Configuration:
---------------
set PATH=%JAVA_PROFILER_HOME%;%PATH%;%TPTP_AGENT_CONTROLLER_HOME%\bin;%JAVA_HOME%\bin

set JAVA_OPTS=%JAVA_OPTS% -agentlib:JPIBootLoader=JPIAgent:server=enabled;CGProf
Comment 9 Mark Birenbaum CLA 2008-03-10 10:13:46 EDT
When using it for actual development purposes (i.e., on the load of my entire application server) the impact seems to be proportionally less.  My server now boots in roughly the same time for both JVMTI and JVMPI  (boot time is not increased by more than 20%).

So I'd be fine with declaring this bug resolved.
Comment 10 Bing Xu CLA 2008-04-04 12:28:44 EDT
Fixed by adding dynamic instrumentation in "enabled" mode in 4.4.0.3
Comment 11 Paul Slauenwhite CLA 2009-06-30 12:11:27 EDT
As of TPTP 4.6.0, TPTP is in maintenance mode and focusing on improving quality by resolving relevant enhancements/defects and increasing test coverage through test creation, automation, Build Verification Tests (BVTs), and expanded run-time execution. As part of the TPTP Bugzilla housecleaning process (see http://wiki.eclipse.org/Bugzilla_Housecleaning_Processes), this enhancement/defect is verified/closed by the Project Lead since this enhancement/defect has been resolved and unverified for more than 1 year and considered to be fixed. If this enhancement/defect is still unresolved and reproducible in the latest TPTP release (http://www.eclipse.org/tptp/home/downloads/), please re-open.