2

I need to debug an application that sometimes produces a StackOverflow exception. This only occurs sometimes, and I do not know where is the problem because the exception is thrown in a thread that is always refreshing a picture, so there is no way to see the full stack trace.

In order to reproduce the error each time I run the application (instead of need to execute it several times until the error suddenly occurs) I want to reduce the JVM's ThreadStackSize. I know how to do this, but what I would like to do is to display the current JVM's thread stack size through the console to be sure that the change is effective.

So, my question is: Does Java provide any mechanism to display the mentioned information during the execution of a specific app?

Dan
  • 2,452
  • 20
  • 45

2 Answers2

2

display the current JVM's thread stack size through the console

jinfo -flag ThreadStackSize PID
apangin
  • 92,924
  • 10
  • 193
  • 247
0

Java Mission Control provides an interface to JVM internals, to stack also. There is a official demo. All you need is to connect to JVM.

By the way: you can implement simple call tracker with counter and call sequence.

Sergei Rybalkin
  • 3,337
  • 1
  • 14
  • 27