profiling remote java application [message #99694] |
Thu, 31 May 2007 09:53 |
Eclipse User |
|
|
|
Originally posted by: hichamm.orcsoftware.com
Hello,
I have a remote process (written in C) that attaches the JVM java6 as a
so file.
I write locally a couple of Java classes which I compile locally and
upload to the remote server and put in that process's CLASSPATH.
The code runs correctly on that remote JVM, I can also debug it, because i
have configured the remote JVM with
-Xrunjdwp:transport=dt_socket,address=<PORT>,server=y,suspend=n
Can I profile that remote JVM to get execution times for my methods?
rds,
|
|
|
Re: profiling remote java application [message #99905 is a reply to message #99694] |
Sun, 03 June 2007 13:04 |
Asaf Yaffe Messages: 333 Registered: July 2009 |
Senior Member |
|
|
Hicham wrote:
> Hello,
>
> I have a remote process (written in C) that attaches the JVM java6 as a
> so file.
> I write locally a couple of Java classes which I compile locally and
> upload to the remote server and put in that process's CLASSPATH.
> The code runs correctly on that remote JVM, I can also debug it, because
> i have configured the remote JVM with
> -Xrunjdwp:transport=dt_socket,address=<PORT>,server=y,suspend=n
>
> Can I profile that remote JVM to get execution times for my methods?
>
> rds,
>
Hicham,
You need to install the Agent Controller on the "remote" machine, and
then launch the JVM with the JVMTI Agent. To do that:
1. Add the Agent Controller 'bin' directory to the PATH and LD_LIBRARY_PATH
2. Set environment variable "JAVA_PROFILER_HOME" to "<Agent Controller
Home>\plugins\org.eclipse.tptp.javaprofiler"
3. Add "JAVA_PROFILER_HOME" to the PATH and LD_LIBRARY_PATH
4. Launch the Java 6 JVM with the following command line argument:
'-agentlib:JPIBootLoader=JPIAgent:server=enabled;CGProf'
Notes:
1. You can use either "controlled" or "enabled" mode. Refer to the JVMTI
Agent documentation to learn more about these modes.
2. By default, CGProf collects only execution statistics. To get
call-tree information, use the following command line:
'-agentlib:JPIBootLoader=JPIAgent:server=enabled;CGProf:exec details=true'
HTH,
Asaf
--
Asaf Yaffe
Eclipse TPTP Committer, JVMTI Profiler
|
|
|
|
Re: profiling remote java application [message #99953 is a reply to message #99938] |
Mon, 04 June 2007 09:00 |
Eclipse User |
|
|
|
Originally posted by: hichamm.orcsoftware.com
Installing and running the Agent controller works, as well as launching
the JVM with the agent on the remote machine
I see then that the controller is listening on 10002 and 10006.
Now I try to attach to it with my Eclipse workbench, at this stage, the
JVM and the application is already running.
Run/Profile:
Attach - Java Process => HOSTS
I added 2 entries for 10002 and 10006 and the remote host.
Test connection is successful.
I go to the Agents tab, and it says Retrieving List...
but nothing appears in the list.
looks like the agent controller cannot find the agent.
|
|
|
Re: profiling remote java application [message #100014 is a reply to message #99953] |
Mon, 04 June 2007 12:10 |
Asaf Yaffe Messages: 333 Registered: July 2009 |
Senior Member |
|
|
hicham wrote:
> Installing and running the Agent controller works, as well as launching
> the JVM with the agent on the remote machine
> I see then that the controller is listening on 10002 and 10006.
>
> Now I try to attach to it with my Eclipse workbench, at this stage, the
> JVM and the application is already running.
> Run/Profile:
> Attach - Java Process => HOSTS
> I added 2 entries for 10002 and 10006 and the remote host.
> Test connection is successful.
>
> I go to the Agents tab, and it says Retrieving List...
> but nothing appears in the list.
>
> looks like the agent controller cannot find the agent.
>
We're currently addressing these issues, with the intent of enabling all
dynamic attach use cases for Wednesday build (TPTP 4.4 RC2).
You may want to try my other suggestion of using "standalone" mode,
profiling into a file, and then importing the file into the workbench.
HTH,
Asaf
--
Asaf Yaffe
Eclipse TPTP Committer, JVMTI Profiler
|
|
|
Re: profiling remote java application [message #100755 is a reply to message #100014] |
Mon, 11 June 2007 12:18 |
Eclipse User |
|
|
|
Originally posted by: hichamm.orcsoftware.com
I import the profiler output file and it works.
However that file, even after filtering to the relevant classes,
becomes very large (1Gbyte).
Are there any options to fine-tune the output?
Is any format (other than XML) accepted by Eclipse?
rds,
Hicham
|
|
|
Re: profiling remote java application [message #100814 is a reply to message #100755] |
Tue, 12 June 2007 06:12 |
Asaf Yaffe Messages: 333 Registered: July 2009 |
Senior Member |
|
|
Hicham wrote:
> I import the profiler output file and it works.
> However that file, even after filtering to the relevant classes,
> becomes very large (1Gbyte).
>
> Are there any options to fine-tune the output?
> Is any format (other than XML) accepted by Eclipse?
>
> rds,
> Hicham
>
You can apply filters at the "runtime" level, to instruct the profiler
to collect data only for certain classes. This usually produces smaller
output files and cause the entire profiling session to run faster.
Filters can be used for the CPU/Call Graph Profiler (CGProf) and Heap
Profiler (HeapProf).
To define filters:
1. Create a simple text file with your filter definition. Each line in
the file specifies a package/class name, method and "mode", which is
either INCLUDE or EXCLUDE. These lines are processed in order, so make
sure to order the filters in a sensible manner.
For example, to include all classes in my.package and exclude everything
else, define a text file with the following entries:
my.package* * INCLUDE
* * EXCLUDE
2. Use the "filters" parameter of JPIAgent to specify the filters file
defined in step 1. For example:
java
-agentlib:JPIBootLoader=JPIAgent:server=standalone;filters=m yfilterfile.txt;CGProf
<Java Class to Profiler>
HTH,
Asaf
--
Asaf Yaffe
Eclipse TPTP Committer, JVMTI Profiler
|
|
|
Powered by
FUDForum. Page generated in 0.03542 seconds