dev@glassfish.java.net

Re: Profiling GlassFish 3.1

From: Tom Mueller <tom.mueller_at_oracle.com>
Date: Tue, 12 Oct 2010 12:07:00 -0500

  Any profiling tool is going to have the same behavior. By definition,
profiling means to periodically take samples of what is happening. You
may or may not see any particular method on the stack for a particular
profile run. It depends on how often that method is actually running.

It sounds like what you want is a tracing tool rather than a profiling
tool.

The initial data that you looked at had a very long profiling interval,
like 100 ms. If you run with a finer grain sample period, you get
better data for a particular method.

Tom


On 10/12/2010 11:57 AM, Shing Wai Chan wrote:
> Hi Tom,
> Is it going to get the profile data that I have seen before?
> In that case, we only get partial data. For instance, we will only get
> the time for WebContainer.postConstruct() without knowing the details
> within the method. Per our discussion, we can "adjust" the timing to
> check whether we can see anything there. But this is not deterministic.
> Is there a tool we can use to profile all the data?
> Please let me know.
> Thanks.
> Shing Wai Chan
>
> On 10/12/10 7:25 AM, Tom Mueller wrote:
>> The best tool that I've seen for profiling GlassFish is the
>> "collect" tool from Sun Studio (now Oracle Studio). Sun Studio is
>> available as part of OpenSolaris and is easy to run in a VM if you
>> have an x86 system. This is also the tool that is recommended by our
>> performance team.
>>
>> To use the collect tool:
>>
>> 1. Start and stop the domain.
>> 2. Grab the Java command line that is used to start the DAS from the
>> server.log file. Put it in a file, add a "\" to the end of each line,
>> and add "collect -j on \" as the first line in the file. You can also
>> add other collect command line options there to change the sample
>> rate, etc.
>> 3. Run the file as a script from the domain's "config" directory.
>> 4. One the DAS is running, perform the operations on it that you want
>> to profile, e.g., deploy, accessing application pages, etc.
>> 5. Run "asadmin stop-domain" to stop the server.
>>
>> The profile data is now in a directory with a name like "test.1.er".
>> To see the data, run the "analyzer" tool on the directory. You can
>> also print out the data using the "er_print" tool. The timeline tab
>> in the analyzer tool is especially useful to see the interactions
>> between various threads within the DAS.
>>
>> This tool works fine with the OSGi infrastructure in GlassFish. If
>> you would like a demo of this, please let me know.
>>
>> Tom
>>
>>
>> On 10/11/2010 6:57 PM, Shing Wai Chan wrote:
>>> Hi,
>>>
>>> I am looking for tools for profiling GlassFish 3.1.
>>> (Note that this is osgi, as default, visualvm does not see the class
>>> in web-glue.jar.)
>>>
>>> Any recommendations?
>>> Thanks.
>>> Shing Wai Chan
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
>>> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>>>
>