Friday, November 4, 2022
HomeITOpenJDK considers async stack traces for Java

OpenJDK considers async stack traces for Java


A proposal selling asynchronous stack traces in Java is advancing by way of the OpenJDK’s Java enhancement course of.

The plan, Asynchronous Stack Hint VM API, would outline an AsyncGetStackTrace API to gather stack traces asynchronously and embrace information on each Java and native stack frames. Targets of the trouble embrace provision of a well-tested API for profilers, which might receive the Java native stack frames data, and assist for asynchronous utilization, corresponding to calling from sign handlers.

As per the proposal, efficiency wouldn’t be affected when the API is just not in use and reminiscence necessities wouldn’t be considerably elevated in comparison with the prevailing AsyncGetCallTrace API. The brand new API wouldn’t be really helpful for manufacturing use, as a result of it may crash the JVM. Plans name for minimizing the possibilities of that by way of intensive testing and fuzzing.

Presently, AsyncGetCallTrace is utilized by most obtainable profilers, each open supply and industrial, together with async-profiler. However it has two main disadvantages. It’s an inner API, not exported in any header, and it solely returns details about Java frames, specifically their technique and bytecode indices. These points make implementing profilers and associated instruments tougher. Though extra data might be extracted from the HotSpot VM by way of advanced code, different helpful data stays hidden, corresponding to whether or not a compiled Java body is inlined, the compilation stage of a Java body, and data on C/C++ frames not on the prime of the stack. This information might be useful for profiling and tuning a VM for a given software and for profiling code that closely makes use of JNI (Java Native Interface).

The AsyncGetStackTrace API can be modeled on the AsyncGetCallTrace API. The brand new API has not but been proposed for a particular model of normal Java. The following model of Java is Java Growth Package (JDK) 20, which is anticipated in March 2023.

Copyright © 2022 IDG Communications, Inc.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments