[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
|
[news.eclipse.tools.hyades] Re: How Hyades Profiler Works
|
Hello,
The Java Profiling Agent (piAgent) currently uses JVMPI to collect data.
The piAgent is capable of collecting instance data and you can enable it by
selecting "Memory Analysis" under your Profiling Configuration if you were
launching an application for profiling from the Eclipse workbench.
When you refer to profiler APIs, do you mean application-controlled APIs
that allow an application to take control of the profiler? There is
currently a set of APIs available for application-controlled profiling.
Under the "org.eclipse.hyades.collection.framework" Hyades project, there is
a class called "org.eclipse.hyades.collection.profiler.Profiler" which
allows profiler operations like "startProfiling()", "analyzeHeap()", etc. To
enable this functionality you will need some change to the data collection
engine's configuration. Under the data collection engine's
"plugins/org.eclipse.hyades.datacollection/config" directory, there is a
file called "pluginconfig.xml". Inside this file, change the line:
<Agent client="DYNAMIC" configuration="default" dataChannelSize="64M"
name="Java Profiling Agent" type="Profiler"/>
to
<Agent client="HEADLESS" configuration="default" dataChannelSize="64M"
name="Java Profiling Agent" type="Profiler"
logFile="/home/eclipse/HelloWorlod.trcxml"/>
This will enable profiling without the Eclipse workbench and redirect the
profiling data to the output file specified by the "logFile" attribute. This
log file can later be imported into the Eclipse workbench for analysis. You
will need to restart the data collection engine after saving the changes to
this file.
You can now start your application (e.g. HelloWorld) like this:
java -XrunpiAgent:server=applicationControlled HelloWorld
and make sure the Hyades data collection engine's jar files are in the
CLASSPATH (those under the "lib" directory of the data collection engine)
and the PATH/LD_LIBRARY_PATH properly set to the data collection's bin/lib
directory (depending on the platform, which points to the .dll or the .so
files).
You java application (i.e. HelloWorld) should first call
"Profiler.getProfiler()" to obtain a handle of the piAgent. After that you
can perform the methods defined in the Profiler class.
Sam
"Sami Lakka" <sami.lakka@xxxxxx> wrote in message
news:cp70e5$2mf$1@xxxxxxxxxxxxxxxxxx
> Hello,
>
>
> I'm just starting to learn the Hyades profiler and I would like to know
how
> hyades
> collects the profiling data. Does it use JVMPI / JVMTI? An another
question
> is
> that does the profiler have an API that other applications could use. I
need
> to get
> information about live instances in the JVM and also the state of these
> instances (e.g.
> to what instances they hold references, state of the private attributes).
Is
> this possible with
> Hyades?
>
>
> Best Regards,
> - Sami Lakka
>
>