Empty output from Tomcat

Help
Walt Mann
2010-10-31
2013-04-17
  • Walt Mann
    Walt Mann
    2010-10-31

    I am trying to instrument a Tomcat 5 app using JIP. I started with the standard webapp.profile.properties and only changed the "output" property to the full path to the output file that I wanted. When I run a "start", followed by several uses of the webapp, followed by a "finish", it produces the output file where I expect, but it contains no information, as though no classes were instrumented.

    So I changed the properties to add "debug=on" and re-ran the same test. I could see that the classes I wanted were being instrumented, but still there was no data in the output file.

    One thing I noticed is that with debug=on, there were many instances of:
    Catch: java/lang/NumberFormatException
    while the webapp was executing, that were not there when debugging was off.

    Any ideas what I'm doing wrong? I fear it's one little setting that I'm getting wrong, so just in case here's my profile.properties:

    ========================
    #
    # Is the profiler on or off when the app starts?
    # (on | off)
    # default = on
    #
    profiler=off
    #
    # Can the profiler be controlled remotely ?
    # (on | off)
    # default = off
    #
    remote=on
    #
    # TCP listen port for remote control
    # default =15599
    #
    port=15599
    #
    # Class Loader filters for different runtine environments
    # (The system will cycle through these until it finds one that
    # can filter in the current environment)
    #
    ClassLoaderFilter.1=com.mentorgen.tools.profile.instrument.clfilter.WebAppClassLoaderFilter
    ClassLoaderFilter.2=com.mentorgen.tools.profile.instrument.clfilter.StandardClassLoaderFilter
    #
    # What is the maximum depth for thread dumps
    # (-1 means no limit)
    # default = -1
    # (you may also use 'compact')
    #
    thread-depth=compact
    #
    # When compacting thread dumps, what in the minimum total time you want
    # to show
    # default = 10 (ms)
    #
    thread.compact.threshold.ms=1
    #
    # What is the maximum number of methods to show in the method dump
    # (-1 means no limit)
    # default = -1
    # (you may also use 'compact')
    #
    max-method-count=compact
    #
    # defaults to 10
    #
    method.compact.threshold.ms=1
    #
    # What is the default file name for the profile information
    # default=./profile.txt
    #
    file=/tmp/jip/profile.txt
    #
    # What packages are excluded from the display
    # (comma separated)
    # Note: com.mentorgen.tools.profile is always excluded
    #
    exclude=org.apache.xalan.xsltc
    debug=on
    track.object.alloc=on
    output=both
    #profiler-class=net.sourceforge.jiprof.timeline.TimeLineProfiler
    ========================

    and here's what I mean by "empty output":

    ========================
    +-----------------------------------------------
    |  File: /tmp/jip/out.txt
    |  Date: 2010.10.31 17:42:01 PM
    +-----------------------------------------------

    +--------------------
    | Thread depth limit: Unlimited
    +--------------------

    +-------------------------
    | Most expensive methods (by net time)
    | Frame Count Limit: Compact
    +-------------------------

                   Net
              --------
    Count     Time    Pct  Location
    =====     ====    ===  ========

    +-------------------------+
    | Most expensive methods summarized    |
    +-------------------------+

                   Net
              --------
    Count     Time    Pct  Location
    =====     ====    ===  ========

    +----------------------+
    | Object Allocation               |
    +----------------------+

         Count Class Name
         ===== ==========
    ========================

    Thanks for your help!

     
  • Andrew Wilcox
    Andrew Wilcox
    2010-11-01

    Interesting.

    Here are a few things to try:

    1. Change output back to the default value. I seriously doubt this will change anything, but some folks have had problems when using absolute paths.

    2. Change the following properties:

    thread-depth=-1
    max-method-count=-1

    It could very well be that your code is already blazingly fast and using 'compact' is causing your code to get filtered out ;-)

    3 . In order get to the point where you're getting at least some output, uncomment the last line of the properties file. This will change the profiler to the TimeLine profiler.

    Andrew.

     
  • Walt Mann
    Walt Mann
    2010-11-01

    Thanks for your quick response. I tried all three of your suggestions. Unfortunately, now the results are even worse! I get a profile.txt in /usr/share/tomcat5/, where expected, but it's completely empty.

    Also, I notice that this file is NOT being generated when I execute finish.sh. Instead, it's only when I actually shut down Tomcat that I see the output:

    TimeLine Profiler: generating output

    and the (empty) file appears.  I do see simple debug messages that say "start" and "finish" in the Tomcat output when I execute the start/finish scripts though, so I know Tomcat is getting something. Is that a clue of some kind?

    Also, is this tool generating intermediate results in some other directory? I'm thinking it could be a permission problem with whatever its doing while the data is being gathered.

    Thanks again.

     
  • Andrew Wilcox
    Andrew Wilcox
    2010-11-02

    Ok, let's nix the TimeLine profiler but keep the thread-depth and max-method-count at -1.

    I suspect that this is a permissions issue, but the file is being created, so it's probably not that. To be safe, you might want to
             chmod -R 777 /tmp

    If you set
             file=/tmp/jip
    you'll be able to send multiple start.sh & finish.sh commands while Tomcat is running. Each time you call finish.sh, a new file should get generated in /tmp/jip. There's also a semi-undocumented call that will reset JIP (telnet host:port clear\n).

    There's also the option to programmaticly cause JIP to start, stop and clear (see the very bottom of the readme.html file).

    Unfortunately, nothing in this message has any real suggestions as to what's going on, only advice on diagnostics.

    Let me know how things go.

    Thanks,

    Andrew.

     
  • Walt Mann
    Walt Mann
    2010-11-02

    Oh boy. I finally figured it out. Our Tomcat had been mis-configured to use an old (1.4.2) version of the JVM! I switched to 1.6 and now I'm getting plenty of data. I was afraid it was something stupid like that. Thanks for sticking with me.

    Walt