Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is "Stack Walking"

It's a phrase I've been hearing a lot recently as I've been trying to improve performance of my application.

See here and here for examples of what I mean.

Usually the way it's mentioned is something like this: "It's slow because it involves a stack walk"

What does a stack walk mean/ what does it mean to walk the stack?

like image 479
Aequitas Avatar asked Aug 06 '15 03:08

Aequitas


People also ask

What is stack Walker?

StackWalker API allows easy filtering and lazy access to execute tasks within any method. It is an efficient API for obtaining stack trace information in Java 9. There are three new important classes in StackWalker API: StackWalker, StackWalker.

What is StackWalker in Java?

A stack walker. The walk method opens a sequential stream of StackFrame s for the current thread and then applies the given function to walk the StackFrame stream.

Which of the following is introduced in Java 9 to get stack frames information in a stack trace of the current thread?

Java 9 has added StackWalker class to provide a standard API for accessing the current thread stack.


1 Answers

The process of Accessing ,Traversal and Filtering of a stack trace can be referred as stack walking. Or in other words we can say that processing a stack trace in any form can be referred as stack walking.A stack trace also called stack backtrace or stack traceback is a report of the active stack frames at a certain point in time during the execution of a program.

Refer to Wikipedia and OpenJDK Documentaion for further details.

like image 135
OshoParth Avatar answered Sep 19 '22 15:09

OshoParth