![]() ![]() ![]() The new agent-loading options are documented and official. Both of these are being removed from future JDK releases.īeginning with JDK 5.0, the new standard option is -agentlib, for example, java -agentlib:hprof, although JDK 5.0 still accepts the -Xrun option. The library itself would use the Java Native Interface (JNI) and either JVM Debug Interface (JVMDI) for debugging or the experimental JVM Profiling Interface (JVMPI) for profiling. The -Xrun option would load the libraries after the VM had initialized itself, sometimes resulting in early VM events not being available to the agent. The option and timing of when these libraries were loaded were nonstandard. The VM would cause that library to be dynamically loaded, and the VM would make a call into that library to get it started. For example, when using HPROF and inputting java - Xrunhprof, the library libhprof.so or hprof.dll would be found in the JDK. In the releases prior to JDK 5.0, an agent was loaded into a virtual machine (VM) at initialization with the option -XrunNAME, where NAME is the name of the native shared library or DLL, such as libNAME.so or NAME.dll. This article explores some basics of writing a JVM TI agent library by walking through the heapTracker demo agent available in the JDK downloads. Profiler tool vendors will often need to create an agent library that uses JVM TI. * These native libraries are sometimes called agent libraries and are often used as a basis for the Java technology-level tool APIs, such as the Java Debugger Interface (JDI) that comes with the Java Development Kit (JDK). The JVM tool interface (JVM TI) is a standard native API that allows for native libraries to capture events and control a Java Virtual Machine (JVM) for the Java platform. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |