Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

jdavidb (1361)

  (email not shown publicly)

J. David Blackstone has a Bachelor of Science in Computer Science and Engineering and nine years of experience at a wireless telecommunications company, where he learned Perl and never looked back. J. David has an advantage in that he works really hard, he has a passion for writing good software, and he knows many of the world's best Perl programmers.

Journal of jdavidb (1361)

Thursday January 31, 2008
09:05 AM

Java stack traces

[ #35536 ]

The call depth of Java exception stack traces never ceases to amaze me. These are easily 200 levels deep. I know I'm seeing things that trace back deep into the bowels of our application server, but I also remember working with much simpler Java programs in school that were still 50 levels deep or so.

I don't think anything I wrote in Perl ever had that many routines calling that many routines. Even if they had a comparable number of routines, they didn't go that deep.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • A lot of systems today use one or more proxies around a number of objects to implement declarative transactions or other goodies. (Of course, these are much easier to implement in Perl or other dynamic languages, but that's another show.) So as a result you'll frequently have a number steps where each proxy intercepts the method, figures out what to dispatch it to, then invoke the relevant method using reflection.

    Fun when debugging, too...
    • Yes; I'm seeing a lot of those.

      There needs to be the equivalent of goto &NAME in Java.

      J. David works really hard, has a passion for writing good software, and knows many of the world's best Perl programmers
  • Yeah, I'm starting to boggle at the Java-length stacks I'm seeing from my code that uses both Moose and POE. Pages and pages long.
    • That's 'cause stevan loves longmess apparently.

      As for Java, the call traces are deep because you see the call stack all the way down to "main". Try going 50 levels deep in a mod_perl app, then looking at the C stack in GDB. It's deep because you have Apache in there, then Perl, then Perl's management of your stack.
      • Be nice if he gave the user the choice. There’s always Carp::Always for those times you do need a full trace, and then you get one from any uncaught exceptions, not just those where the author coöperated. And the rest of the time, you can leave it out.