Profiling a single context within tomcat

Questions about YourKit Java Profiler
Post Reply
rmcmahon
Posts: 7
Joined: Thu Dec 02, 2004 5:11 pm

Profiling a single context within tomcat

Post by rmcmahon »

I'm currently trying to profile one of many webapps running within a tomcat instance. Are there any recommendations or best practises for defining an object set that encompasses just one app/context?

I've tried something like the following:

<reachable-objects>
<from>
<objects class="com.digitalbridges.repository.Repository"/>
</from>
<object-filter>
<and>
<objects class="*"/>
<not>
<objects class="org.apache.catalina.session.StandardManager"/>
</not>
</and>
</object-filter>
<field-filter>
</field-filter>
</reachable-objects>

to find everything reachable from my Repository singleton, but the classloaders, tag pools and tomcat infrastructure classes means that virtually everything running within the instance is included.

Any help appreciated
--Richie
Vladimir Kondratyev
Posts: 1624
Joined: Tue Aug 10, 2004 7:52 pm

Post by Vladimir Kondratyev »

Could you please clarify your problem. Do you have several instances of one webapp running inside Tomcat, 1do you need to distinguish instances? Or you have several different webapps and want to calculate retained size of one particular?
rmcmahon
Posts: 7
Joined: Thu Dec 02, 2004 5:11 pm

Post by rmcmahon »

Yes, I'd like to find the retained object set for one of our applications. Each app on that server is different, but several use the same libraries so it would be good to disambiguate the owner of the objects.

From playing around, I think I want to find the

org.apache.catalina.core.StandardContext

instance that relates to the one webapp I am interested in, then ignore anything above that context (no mean feat as every tomcat object seems to have a parent, or context, or loader property that points back up the way). I'm guessing that I can use the object-filters forbidden fields to do this for me?

Anyway, in the object viewer I can find my StandardContext instance by looking for the name property but I don't know how to specify these as rules in the object set editor. Any help appreciated.
Post Reply