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 What is Rust? Safe, fast, and easy software development Unlike most programming languages, Rust doesn't make you choose between speed, safety, and ease of use. Find out how Rust delivers better code with fewer compromises, and a few downsides to consider before learning Rust. By Serdar Yegulalp Nov 20, 2024 11 mins Rust Programming Languages Software Development how-to Kotlin for Java developers: Classes and coroutines Kotlin was designed to bring more flexibility and flow to programming in the JVM. Here's an in-depth look at how Kotlin makes working with classes and objects easier and introduces coroutines to modernize concurrency. By Matthew Tyson Nov 20, 2024 9 mins Java Kotlin Programming Languages analysis Azure AI Foundry tools for changes in AI applications Microsoft’s launch of Azure AI Foundry at Ignite 2024 signals a welcome shift from chatbots to agents and to using AI for business process automation. By Simon Bisson Nov 20, 2024 7 mins Microsoft Azure Generative AI Development Tools news Microsoft unveils imaging APIs for Windows Copilot Runtime Generative AI-backed APIs will allow developers to build image super resolution, image segmentation, object erase, and OCR capabilities into Windows applications. By Paul Krill Nov 19, 2024 2 mins Generative AI APIs Development Libraries and Frameworks Resources Videos