0

I have to understand a old, large java code base not written by me.

To track any flow, If I know any class which gets called in that flow, I throw an Exception (like below) to get a stack trace to console, to understand which methods called so far and continue further.

        try {
            throw new Exception();
        } catch (Exception e) {
            e.printStackTrace();
        }

This helps me some extent, But I am completely blind about other flows, where I don't know entry/middle/exit points in that flow.

I am wondering is there any tool or mechanism which tells what JVM is currently executing?

Bhargav Kumar R
  • 2,190
  • 3
  • 22
  • 38

1 Answers1

0

If you want to understand what threads in the JVM are doing, you can capture a thread dump by kill -3 pid and watch the stdout, or by using jconsole. You can capture a few dumps which is a few seconds far from each other, such that you can feel how the 'current' function moves from one place to another.

If you want to trace/log and understand what values coming and out of your functions, you can use Jackplay.

Alfred Xiao
  • 1,758
  • 15
  • 16