OpenJDK is considering including the asynchronous API Stack Trace VM 

OpenJDK

OpenJDK is the free version of the Java development platform under the concept of object-oriented language.

Recently a proposal was released to promote asynchronous stack traces in Java and that it is thriving in OpenJDK's Java enhancement process. The project is intended to define an AsyncGetStackTrace API to collect stack traces asynchronously and include data about Java and native stack frameworks.

According to the proposal, performance would not be affected when the API is not in use and the memory requirements would not increase significantly compared to the existing AsyncGetCallTrace API. The new API would not be recommended for production use as it could crash the JVM. Plans include minimizing the risks of such an incident through extensive testing and verification.

AsyncGetCallTrace is used by most generators of profiles available, both open source and commercial, including async-profiler. But it has two big drawbacks.

  1. this is an internal API, not exported in any headers;
  2. it only returns information about Java frames, i.e. their method and bytecode indices.

These issues make it difficult to implement profilers and related tools. Although additional information can be extracted from the HotSpot VM through complex code, other useful information is hidden and impossible to obtain:

Whether a compiled Java framework is online (currently only obtainable for higher compiled frameworks).

The build level of a Java framework (that is, compiled by C1 or C2).
Information about C/C++ frameworks that are not at the top of the stack.

These dates can be useful when profiling and tuning a virtual machine for a given application, as well as when profiling code that uses a lot of JNI.

The API would be modeled on APIAsyncGetCallTrace, Also, the new API has not yet been offered for a specific version of the Java standard. The next release of Java is (JDK) 20, which is expected in March 2023. Java has a formal process for incorporating platform changes that has managed to respond to changing circumstances while achieving a high degree of stability.

Profilers can call this API to get the stack trace for the currently executing thread. Calling this API from a signal handler is safe, and the new implementation will be at least as stable as the JFR stack trace code. The virtual machine fills in the frame information and frame count. The API caller must allocate the call array with enough memory for the requested stack depth.

The virtual machine completes the trace structure that contains the actual number of images in the image array or an error code. The error codes are a subset of the error codes for AsyncGetCallTrace.

Although the API provides more information, the space required per frame (for example, 16 bytes on x86) is the same as for the existing APIAsyncGetCallTrace. Returning information about C/C++ frameworks results in disclosure of implementation details, but this is also true for AsyncGetCallTrace Java frameworks as they reveal implementation details of standard library files and include native wrapper frameworks .

Even an experienced Java developer may not have a good understanding how the platform is developed and maintained. The main lesson to be learned is that this is truly an open process.

The basis of Java development is the Java Community Process (JCP). It is a kind of self-aware basic document that defines how to introduce changes in the platform and also allows to modify the process itself. The latest version of the JCP is 2.11, which was adopted in 2019.

JCP formalizes how new features and changes in Java are proposed, reviewed, and approved. (i.e. technical specifications), including the definition of various roles that people can occupy. These roles help provide a place where the Java user community can participate in the governance of the platform.

To propose new functionality and changes, JCP allows the creation ("initialization") of Java Specification Requests (JSR). This is done through a standardized form. To access the form, you must register for a free JCP account.

From there, many changes, small or not, come to the Java technologies that we use every day. When a JSR arrives, it enters the JSR review process. It is a multi-step process in which changes proposed in the JSR are gradually considered more seriously, modified, and ultimately adopted or discontinued.

Finally if you are interested in knowing more about it, you can check the details In the following link.


Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: AB Internet Networks 2008 SL
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.