Fine-Grained Stack Tracing

Java 9 comes with a new stack walker API that lets the program walk the calling stack. This is a very special functionality that is rarely needed by ordinary programs. The API can be useful for some very special cases--for functionality that is delivered by framework. So, if you want an efficient means of stack walking that gives you filterable access to stack trace information, you will enjoy this new stack walker API.

The API gives fast and optimized access to the call stack, implementing lazy access to the individual frames.

In this chapter, we cover the following topics:

  • Overview of the Java Stack
  • The importance of stack information
  • Using StackWalker
  • The StackFrame
  • Performance

Get Java 9: Building Robust Modular Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.