Proposal would define an API to collect stack traces asynchronously and include information on both Java and native stack frames. Credit: Christoph A proposal promoting asynchronous stack traces in Java is advancing through the OpenJDK’s Java enhancement process. The plan, Asynchronous Stack Trace VM API, would define an AsyncGetStackTrace API to collect stack traces asynchronously and include data on both Java and native stack frames. Goals of the effort include provision of a well-tested API for profilers, which would obtain the Java native stack frames information, and support for asynchronous usage, such as calling from signal handlers. As per the proposal, performance would not be affected when the API is not in use and memory requirements would not be significantly increased compared to the existing AsyncGetCallTrace API. The new API would not be recommended for production use, because it could crash the JVM. Plans call for minimizing the chances of that through extensive testing and fuzzing. Currently, AsyncGetCallTrace is used by most available profilers, both open source and commercial, including async-profiler. But it has two major disadvantages. It is an internal API, not exported in any header, and it only returns information about Java frames, namely their method and bytecode indices. These issues make implementing profilers and related tools more difficult. Although additional information can be extracted from the HotSpot VM through complex code, other useful information remains hidden, such as whether a compiled Java frame is inlined, the compilation level of a Java frame, and information on C/C++ frames not at the top of the stack. This data can be helpful for profiling and tuning a VM for a given application and for profiling code that heavily uses JNI (Java Native Interface). The AsyncGetStackTrace API would be modeled on the AsyncGetCallTrace API. The new API has not yet been proposed for a specific version of standard Java. The next version of Java is Java Development Kit (JDK) 20, which is expected in March 2023. Related content feature 14 great preprocessors for developers who love to code Sometimes it seems like the rules of programming are designed to make coding a chore. Here are 14 ways preprocessors can help make software development fun again. By Peter Wayner Nov 18, 2024 10 mins Development Tools Software Development feature Designing the APIs that accidentally power businesses Well-designed APIs, even those often-neglected internal APIs, make developers more productive and businesses more agile. By Jean Yang Nov 18, 2024 6 mins APIs Software Development news Spin 3.0 supports polyglot development using Wasm components Fermyon’s open source framework for building server-side WebAssembly apps allows developers to compose apps from components created with different languages. By Paul Krill Nov 18, 2024 2 mins Microservices Serverless Computing Development Libraries and Frameworks news Go language evolving for future hardware, AI workloads The Go team is working to adapt Go to large multicore systems, the latest hardware instructions, and the needs of developers of large-scale AI systems. By Paul Krill Nov 15, 2024 3 mins Google Go Generative AI Programming Languages Resources Videos