JDK-8268829 : Provide an optimized way to walk the stack with Class object only
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.lang
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2021-06-15
  • Updated: 2023-09-14
  • Resolved: 2023-09-07
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 22
22 b15Fixed
Related Reports
CSR :  
Relates :  
Description
StackWalker::walk creates one StackFrame per frame and the current implementation allocates one StackFrameInfo and one MemberName objects per frame.  Some frameworks like logging may only interest in the Class object but not the method name nor the BCI.    For example, java.util.logging filters out its implementation classes to find the caller class to log in the LogRecrod.   It's something similar to `StackWalker::getCallerClass` but allows a predicate to filter out the element.    In this case, only the buffer to hold the classes on the stack is allocated.
Comments
Changeset: 111ecdba Author: Mandy Chung <mchung@openjdk.org> Date: 2023-09-07 21:37:40 +0000 URL: https://git.openjdk.org/jdk/commit/111ecdbaf58e5c0b3a64e0eca8a291df295e71b0
07-09-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/15370 Date: 2023-08-21 20:07:20 +0000
21-08-2023