blob: 66befc90b5f242ffec932b9ee5b843c7c4ea1e3b [file] [log] [blame]
<!--
* Copyright (c) 2017, 2021 IBM Corp. and others
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution and is available at
* https://www.eclipse.org/legal/epl-2.0/ or the Apache
* License, Version 2.0 which accompanies this distribution and
* is available at https://www.apache.org/licenses/LICENSE-2.0.
*
* This Source Code may also be made available under the
* following Secondary Licenses when the conditions for such
* availability set forth in the Eclipse Public License, v. 2.0
* are satisfied: GNU General Public License, version 2 with
* the GNU Classpath Exception [1] and GNU General Public
* License, version 2 with the OpenJDK Assembly Exception [2].
*
* [1] https://www.gnu.org/software/classpath/license.html
* [2] http://openjdk.java.net/legal/assembly-exception.html
*
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH
* Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception
-->
<!DOCTYPE html>
<html lang="en" class="no-js">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="description" content="Eclipse OpenJ9 documentation">
<link rel="canonical" href="https://www.eclipse.org/openj9/docs/interface_jvmti/">
<meta name="lang:clipboard.copy" content="">
<meta name="lang:clipboard.copied" content="">
<meta name="lang:search.language" content="">
<meta name="lang:search.pipeline.stopwords" content="">
<meta name="lang:search.pipeline.trimmer" content="">
<meta name="lang:search.result.none" content="">
<meta name="lang:search.result.one" content="">
<meta name="lang:search.result.other" content="">
<meta name="lang:search.tokenizer" content="">
<link rel="shortcut icon" href="../cr/oj9logo_img9.ico">
<meta name="generator" content="mkdocs-1.0.4, mkdocs-material-3.0.4">
<title>JVMTI - </title>
<link rel="stylesheet" href="../assets/stylesheets/application.1b62728e.css">
<link rel="stylesheet" href="../assets/stylesheets/application-palette.a8b3c06d.css">
<meta name="theme-color" content="#00bcd4">
<script src="../assets/javascripts/modernizr.268332fc.js"></script>
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono">
<style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
<link rel="stylesheet" href="../assets/fonts/material-icons.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="../stylesheets/oj9.css">
<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f (https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore%28j,f) );
})(window,document,'script','dataLayer','GTM-5WLCZXC');</script>
<!-- End Google Tag Manager -->
</head>
<body dir="" data-md-color-primary="cyan" data-md-color-accent="cyan">
<svg class="md-svg">
<defs>
<svg xmlns="http://www.w3.org/2000/svg" width="416" height="448" viewBox="0 0 416 448" id="__github"><path fill="currentColor" d="M160 304q0 10-3.125 20.5t-10.75 19T128 352t-18.125-8.5-10.75-19T96 304t3.125-20.5 10.75-19T128 256t18.125 8.5 10.75 19T160 304zm160 0q0 10-3.125 20.5t-10.75 19T288 352t-18.125-8.5-10.75-19T256 304t3.125-20.5 10.75-19T288 256t18.125 8.5 10.75 19T320 304zm40 0q0-30-17.25-51T296 232q-10.25 0-48.75 5.25Q229.5 240 208 240t-39.25-2.75Q130.75 232 120 232q-29.5 0-46.75 21T56 304q0 22 8 38.375t20.25 25.75 30.5 15 35 7.375 37.25 1.75h42q20.5 0 37.25-1.75t35-7.375 30.5-15 20.25-25.75T360 304zm56-44q0 51.75-15.25 82.75-9.5 19.25-26.375 33.25t-35.25 21.5-42.5 11.875-42.875 5.5T212 416q-19.5 0-35.5-.75t-36.875-3.125-38.125-7.5-34.25-12.875T37 371.5t-21.5-28.75Q0 312 0 260q0-59.25 34-99-6.75-20.5-6.75-42.5 0-29 12.75-54.5 27 0 47.5 9.875t47.25 30.875Q171.5 96 212 96q37 0 70 8 26.25-20.5 46.75-30.25T376 64q12.75 25.5 12.75 54.5 0 21.75-6.75 42 34 40 34 99.5z"/></svg>
</defs>
</svg>
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
<a href="../#java-virtual-machine-tool-interface" tabindex="1" class="md-skip">
</a>
<!--
* Copyright (c) 2017, 2021 IBM Corp. and others
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution and is available at
* https://www.eclipse.org/legal/epl-2.0/ or the Apache
* License, Version 2.0 which accompanies this distribution and
* is available at https://www.apache.org/licenses/LICENSE-2.0.
*
* This Source Code may also be made available under the
* following Secondary Licenses when the conditions for such
* availability set forth in the Eclipse Public License, v. 2.0
* are satisfied: GNU General Public License, version 2 with
* the GNU Classpath Exception [1] and GNU General Public
* License, version 2 with the OpenJDK Assembly Exception [2].
*
* [1] https://www.gnu.org/software/classpath/license.html
* [2] http://openjdk.java.net/legal/assembly-exception.html
*
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH
* Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception
-->
<header class="md-header" data-md-component="header">
<nav class="md-header-nav md-grid">
<div class="md-flex">
<div class="md-flex__cell md-flex__cell--shrink">
<a href="https://www.eclipse.org/openj9/docs" title=" " class="md-header-nav__button md-logo">
<img src="../cr/openj9_6b.png">
</a>
</div>
<div class="md-flex__cell md-flex__cell--shrink">
<label class="md-icon md-icon--menu md-header-nav__button" for="__drawer"></label>
</div>
<div class="md-flex__cell md-flex__cell--stretch">
<div class="md-flex__ellipsis md-header-nav__title" data-md-component="title">
</div>
</div>
<div class="md-flex__cell md-flex__cell--shrink">
<label class="md-icon md-icon--search md-header-nav__button" for="search"></label>
<div class="md-search" data-md-component="search" role="dialog">
<label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search">
<form class="md-search__form" name="search">
<input type="text" class="md-search__input" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">
<label class="md-icon md-search__icon" for="__search"></label>
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
&#xE5CD;
</button>
</form>
<div class="md-search__output">
<div class="md-search__scrollwrap" data-md-scrollfix>
<div class="md-search-result" data-md-component="result">
<div class="md-search-result__meta">
</div>
<ol class="md-search-result__list"></ol>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="md-flex__cell md-flex__cell--shrink">
<div class="md-header-nav__source">
<a href="https://github.com/eclipse/openj9/" title="Go to repository" class="md-source" data-md-source="github">
<div class="md-source__icon">
<svg viewBox="0 0 24 24" width="24" height="24">
<use xlink:href="#__github" width="24" height="24"></use>
</svg>
</div>
<div class="md-source__repository">
eclipse/openj9
</div>
</a>
</div>
</div>
</div>
</nav>
</header>
<div class="md-container">
<main class="md-main">
<div class="md-main__inner md-grid" data-md-component="container">
<div class="md-sidebar md-sidebar--primary" data-md-component="navigation">
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
<nav class="md-nav md-nav--primary" data-md-level="0">
<label class="md-nav__title md-nav__title--site" for="__drawer">
<a href="https://www.eclipse.org/openj9/docs" title=" " class="md-nav__button md-logo">
<img src="../cr/openj9_6b.png" width="48" height="48">
</a>
</label>
<div class="md-nav__source">
<a href="https://github.com/eclipse/openj9/" title="Go to repository" class="md-source" data-md-source="github">
<div class="md-source__icon">
<svg viewBox="0 0 24 24" width="24" height="24">
<use xlink:href="#__github" width="24" height="24"></use>
</svg>
</div>
<div class="md-source__repository">
eclipse/openj9
</div>
</a>
</div>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href=".." title="About the docs" class="md-nav__link">
About the docs
</a>
</li>
<li class="md-nav__item">
<a href="../builds/" title="OpenJ9 builds" class="md-nav__link">
OpenJ9 builds
</a>
</li>
<li class="md-nav__item">
<a href="../introduction/" title="Getting started" class="md-nav__link">
Getting started
</a>
</li>
<li class="md-nav__item">
<a href="../openj9_newuser/" title="New to OpenJ9?" class="md-nav__link">
New to OpenJ9?
</a>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-toggle md-nav__toggle" data-md-toggle="nav-5" type="checkbox" id="nav-5">
<label class="md-nav__link" for="nav-5">
Release notes
</label>
<nav class="md-nav" data-md-component="collapsible" data-md-level="1">
<label class="md-nav__title" for="nav-5">
Release notes
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../openj9_releases/" title="Overview" class="md-nav__link">
Overview
</a>
</li>
<li class="md-nav__item">
<a href="../version0.25/" title="Version 0.25.0" class="md-nav__link">
Version 0.25.0
</a>
</li>
<li class="md-nav__item">
<a href="../version0.24/" title="Version 0.24.0" class="md-nav__link">
Version 0.24.0
</a>
</li>
<li class="md-nav__item">
<a href="../version0.23/" title="Version 0.23.0" class="md-nav__link">
Version 0.23.0
</a>
</li>
<li class="md-nav__item">
<a href="../version0.22/" title="Version 0.22.0" class="md-nav__link">
Version 0.22.0
</a>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-toggle md-nav__toggle" data-md-toggle="nav-5-6" type="checkbox" id="nav-5-6">
<label class="md-nav__link" for="nav-5-6">
Earlier releases
</label>
<nav class="md-nav" data-md-component="collapsible" data-md-level="2">
<label class="md-nav__title" for="nav-5-6">
Earlier releases
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../version0.21/" title="Version 0.21.0" class="md-nav__link">
Version 0.21.0
</a>
</li>
<li class="md-nav__item">
<a href="../version0.20/" title="Version 0.20.0" class="md-nav__link">
Version 0.20.0
</a>
</li>
<li class="md-nav__item">
<a href="../version0.19/" title="Version 0.19.0" class="md-nav__link">
Version 0.19.0
</a>
</li>
<li class="md-nav__item">
<a href="../version0.18/" title="Version 0.18.1" class="md-nav__link">
Version 0.18.1
</a>
</li>
<li class="md-nav__item">
<a href="../version0.17/" title="Version 0.17.0" class="md-nav__link">
Version 0.17.0
</a>
</li>
<li class="md-nav__item">
<a href="../version0.16/" title="Version 0.16.0" class="md-nav__link">
Version 0.16.0
</a>
</li>
<li class="md-nav__item">
<a href="../version0.15/" title="Version 0.15.1" class="md-nav__link">
Version 0.15.1
</a>
</li>
<li class="md-nav__item">
<a href="../version0.14/" title="Version 0.14.0" class="md-nav__link">
Version 0.14.0
</a>
</li>
<li class="md-nav__item">
<a href="../version0.13/" title="Version 0.13.0" class="md-nav__link">
Version 0.13.0
</a>
</li>
<li class="md-nav__item">
<a href="../version0.12/" title="Version 0.12.0" class="md-nav__link">
Version 0.12.0
</a>
</li>
<li class="md-nav__item">
<a href="../version0.11/" title="Version 0.11.0" class="md-nav__link">
Version 0.11.0
</a>
</li>
<li class="md-nav__item">
<a href="../version0.10/" title="Version 0.10.0" class="md-nav__link">
Version 0.10.0
</a>
</li>
<li class="md-nav__item">
<a href="../version0.9/" title="Version 0.9.0" class="md-nav__link">
Version 0.9.0
</a>
</li>
<li class="md-nav__item">
<a href="../version0.8/" title="Version 0.8.0" class="md-nav__link">
Version 0.8.0
</a>
</li>
</ul>
</nav>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-toggle md-nav__toggle" data-md-toggle="nav-6" type="checkbox" id="nav-6">
<label class="md-nav__link" for="nav-6">
Memory management
</label>
<nav class="md-nav" data-md-component="collapsible" data-md-level="1">
<label class="md-nav__title" for="nav-6">
Memory management
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../allocation/" title="Heap allocation" class="md-nav__link">
Heap allocation
</a>
</li>
<li class="md-nav__item">
<a href="../gc_overview/" title="Garbage Collection (GC)" class="md-nav__link">
Garbage Collection (GC)
</a>
</li>
<li class="md-nav__item">
<a href="../gc/" title="GC policies" class="md-nav__link">
GC policies
</a>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-toggle md-nav__toggle" data-md-toggle="nav-6-4" type="checkbox" id="nav-6-4">
<label class="md-nav__link" for="nav-6-4">
Troubleshooting GC
</label>
<nav class="md-nav" data-md-component="collapsible" data-md-level="2">
<label class="md-nav__title" for="nav-6-4">
Troubleshooting GC
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../vgclog/" title="Verbose GC logs" class="md-nav__link">
Verbose GC logs
</a>
</li>
<li class="md-nav__item">
<a href="../vgclog_examples/" title="Log examples" class="md-nav__link">
Log examples
</a>
</li>
</ul>
</nav>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="../jit/" title="JIT Compiler" class="md-nav__link">
JIT Compiler
</a>
</li>
<li class="md-nav__item">
<a href="../jitserver/" title="JITServer (tech. preview)" class="md-nav__link">
JITServer (tech. preview)
</a>
</li>
<li class="md-nav__item">
<a href="../aot/" title="AOT Compiler" class="md-nav__link">
AOT Compiler
</a>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-toggle md-nav__toggle" data-md-toggle="nav-10" type="checkbox" id="nav-10">
<label class="md-nav__link" for="nav-10">
Class data sharing
</label>
<nav class="md-nav" data-md-component="collapsible" data-md-level="1">
<label class="md-nav__title" for="nav-10">
Class data sharing
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../shrc/" title="Overview" class="md-nav__link">
Overview
</a>
</li>
<li class="md-nav__item">
<a href="../shrc_diag_util/" title="Diagnostic cache utilities" class="md-nav__link">
Diagnostic cache utilities
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="../attachapi/" title="Java Attach API" class="md-nav__link">
Java Attach API
</a>
</li>
<li class="md-nav__item md-nav__item--active md-nav__item--nested">
<input class="md-toggle md-nav__toggle" data-md-toggle="nav-12" type="checkbox" id="nav-12" checked>
<label class="md-nav__link" for="nav-12">
Diagnostics
</label>
<nav class="md-nav" data-md-component="collapsible" data-md-level="1">
<label class="md-nav__title" for="nav-12">
Diagnostics
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../diag_overview/" title="Overview" class="md-nav__link">
Overview
</a>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-toggle md-nav__toggle" data-md-toggle="nav-12-2" type="checkbox" id="nav-12-2">
<label class="md-nav__link" for="nav-12-2">
Dumps
</label>
<nav class="md-nav" data-md-component="collapsible" data-md-level="2">
<label class="md-nav__title" for="nav-12-2">
Dumps
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../dump_javadump/" title="Java dump" class="md-nav__link">
Java dump
</a>
</li>
<li class="md-nav__item">
<a href="../dump_heapdump/" title="Heap dump" class="md-nav__link">
Heap dump
</a>
</li>
<li class="md-nav__item">
<a href="../dump_systemdump/" title="System dump" class="md-nav__link">
System dump
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-toggle md-nav__toggle" data-md-toggle="nav-12-3" type="checkbox" id="nav-12-3">
<label class="md-nav__link" for="nav-12-3">
Tools
</label>
<nav class="md-nav" data-md-component="collapsible" data-md-level="2">
<label class="md-nav__title" for="nav-12-3">
Tools
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../tool_jextract/" title="Dump extractor" class="md-nav__link">
Dump extractor
</a>
</li>
<li class="md-nav__item">
<a href="../tool_jdmpview/" title="Dump viewer" class="md-nav__link">
Dump viewer
</a>
</li>
<li class="md-nav__item">
<a href="../tool_traceformat/" title="Trace formatter" class="md-nav__link">
Trace formatter
</a>
</li>
<li class="md-nav__item">
<a href="../tool_builder/" title="Option builder" class="md-nav__link">
Option builder
</a>
</li>
<li class="md-nav__item">
<a href="../tool_jcmd/" title="Java command (jcmd) tool" class="md-nav__link">
Java command (jcmd) tool
</a>
</li>
<li class="md-nav__item">
<a href="../tool_jmap/" title="Java memory map (jmap) tool" class="md-nav__link">
Java memory map (jmap) tool
</a>
</li>
<li class="md-nav__item">
<a href="../tool_jps/" title="Java process status (jps)" class="md-nav__link">
Java process status (jps)
</a>
</li>
<li class="md-nav__item">
<a href="../tool_jstack/" title="Java stack (jstack) tool" class="md-nav__link">
Java stack (jstack) tool
</a>
</li>
<li class="md-nav__item">
<a href="../tool_jstat/" title="Java statistics monitoring (jstat) tool" class="md-nav__link">
Java statistics monitoring (jstat) tool
</a>
</li>
<li class="md-nav__item">
<a href="../tool_migration/" title="Switching to OpenJ9" class="md-nav__link">
Switching to OpenJ9
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--active md-nav__item--nested">
<input class="md-toggle md-nav__toggle" data-md-toggle="nav-12-4" type="checkbox" id="nav-12-4" checked>
<label class="md-nav__link" for="nav-12-4">
Interfaces
</label>
<nav class="md-nav" data-md-component="collapsible" data-md-level="2">
<label class="md-nav__title" for="nav-12-4">
Interfaces
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item md-nav__item--active">
<input class="md-toggle md-nav__toggle" data-md-toggle="toc" type="checkbox" id="__toc">
<label class="md-nav__link md-nav__link--active" for="__toc">
JVMTI
</label>
<a href="./" title="JVMTI" class="md-nav__link md-nav__link--active">
JVMTI
</a>
<nav class="md-nav md-nav--secondary">
<label class="md-nav__title" for="__toc">On this page ...</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="#overview" class="md-nav__link">
Overview
</a>
</li>
<li class="md-nav__item">
<a href="#openj9-extensions" class="md-nav__link">
OpenJ9 extensions
</a>
</li>
<li class="md-nav__item">
<a href="#sample-jvmti-agent" class="md-nav__link">
Sample JVMTI agent
</a>
<nav class="md-nav">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#agent_onload" class="md-nav__link">
Agent_OnLoad()
</a>
</li>
<li class="md-nav__item">
<a href="#dumpstartcallback" class="md-nav__link">
DumpStartCallback()
</a>
</li>
<li class="md-nav__item">
<a href="#using-the-sample-jvmti-agent" class="md-nav__link">
Using the sample JVMTI agent
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#api-reference" class="md-nav__link">
API reference
</a>
<nav class="md-nav">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#getosthreadid" class="md-nav__link">
GetOSThreadID
</a>
</li>
<li class="md-nav__item">
<a href="#queryvmdump" class="md-nav__link">
QueryVmDump
</a>
</li>
<li class="md-nav__item">
<a href="#setvmdump" class="md-nav__link">
SetVmDump
</a>
</li>
<li class="md-nav__item">
<a href="#triggervmdump" class="md-nav__link">
TriggerVmDump
</a>
</li>
<li class="md-nav__item">
<a href="#resetvmdump" class="md-nav__link">
ResetVmDump
</a>
</li>
<li class="md-nav__item">
<a href="#vmdumpstart" class="md-nav__link">
VMDumpStart
</a>
</li>
<li class="md-nav__item">
<a href="#vmdumpend" class="md-nav__link">
VMDumpEnd
</a>
</li>
<li class="md-nav__item">
<a href="#setvmtrace" class="md-nav__link">
SetVmTrace
</a>
</li>
<li class="md-nav__item">
<a href="#registertracepointsubscriber" class="md-nav__link">
RegisterTracePointSubscriber
</a>
<nav class="md-nav">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#jvmtitracesubscriber-function" class="md-nav__link">
jvmtiTraceSubscriber function
</a>
</li>
<li class="md-nav__item">
<a href="#jvmtitracealarm-function" class="md-nav__link">
jvmtiTraceAlarm function
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#deregistertracepointsubscriber" class="md-nav__link">
DeregisterTracePointSubscriber
</a>
</li>
<li class="md-nav__item">
<a href="#getmemorycategories" class="md-nav__link">
GetMemoryCategories
</a>
</li>
<li class="md-nav__item">
<a href="#queryvmlogoptions" class="md-nav__link">
QueryVmLogOptions
</a>
</li>
<li class="md-nav__item">
<a href="#setvmlogoptions" class="md-nav__link">
SetVmLogOptions
</a>
</li>
<li class="md-nav__item">
<a href="#iteratesharedcaches" class="md-nav__link">
IterateSharedCaches
</a>
<nav class="md-nav">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#jvmtiiteratesharedcachescallback-function" class="md-nav__link">
jvmtiIterateSharedCachesCallback function
</a>
</li>
<li class="md-nav__item">
<a href="#jvmtisharedcacheinfo-structure" class="md-nav__link">
jvmtiSharedCacheInfo structure
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#destroysharedcache" class="md-nav__link">
DestroySharedCache
</a>
</li>
<li class="md-nav__item">
<a href="#registerverbosegcsubscriber" class="md-nav__link">
RegisterVerboseGCSubscriber
</a>
<nav class="md-nav">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#jvmtiverbosegcsubscriber-function" class="md-nav__link">
jvmtiVerboseGCSubscriber function
</a>
</li>
<li class="md-nav__item">
<a href="#jvmtiverbosegcalarm-function" class="md-nav__link">
jvmtiVerboseGCAlarm function
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#deregisterverbosegcsubscriber" class="md-nav__link">
DeregisterVerboseGCSubscriber
</a>
</li>
</ul>
</nav>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="../interface_dtfj/" title="DTFJ" class="md-nav__link">
DTFJ
</a>
</li>
<li class="md-nav__item">
<a href="../interface_lang_management/" title="Language Management" class="md-nav__link">
Language Management
</a>
</li>
</ul>
</nav>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-toggle md-nav__toggle" data-md-toggle="nav-13" type="checkbox" id="nav-13">
<label class="md-nav__link" for="nav-13">
Command-line options
</label>
<nav class="md-nav" data-md-component="collapsible" data-md-level="1">
<label class="md-nav__title" for="nav-13">
Command-line options
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../cmdline_specifying/" title="Specifying options" class="md-nav__link">
Specifying options
</a>
</li>
<li class="md-nav__item">
<a href="../cmdline_general/" title="Standard options" class="md-nav__link">
Standard options
</a>
</li>
<li class="md-nav__item">
<a href="../cmdline_migration/" title="Switching to OpenJ9" class="md-nav__link">
Switching to OpenJ9
</a>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-toggle md-nav__toggle" data-md-toggle="nav-13-4" type="checkbox" id="nav-13-4">
<label class="md-nav__link" for="nav-13-4">
System property options
</label>
<nav class="md-nav" data-md-component="collapsible" data-md-level="2">
<label class="md-nav__title" for="nav-13-4">
System property options
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../d_jvm_commands/" title="Using System properties" class="md-nav__link">
Using System properties
</a>
</li>
<li class="md-nav__item">
<a href="../dcomibmenableclasscaching/" title="-Dcom.ibm.enableClassCaching" class="md-nav__link">
-Dcom.ibm.enableClassCaching
</a>
</li>
<li class="md-nav__item">
<a href="../dcomibmenablelegacydumpsecurity/" title="-Dcom.ibm.enableLegacyDumpSecurity" class="md-nav__link">
-Dcom.ibm.enableLegacyDumpSecurity
</a>
</li>
<li class="md-nav__item">
<a href="../dcomibmenablelegacylogsecurity/" title="-Dcom.ibm.enableLegacyLogSecurity" class="md-nav__link">
-Dcom.ibm.enableLegacyLogSecurity
</a>
</li>
<li class="md-nav__item">
<a href="../dcomibmenablelegacytracesecurity/" title="-Dcom.ibm.enableLegacyTraceSecurity" class="md-nav__link">
-Dcom.ibm.enableLegacyTraceSecurity
</a>
</li>
<li class="md-nav__item">
<a href="../dcomibmgpudisable/" title="-Dcom.ibm.gpu.disable" class="md-nav__link">
-Dcom.ibm.gpu.disable
</a>
</li>
<li class="md-nav__item">
<a href="../dcomibmgpuenable/" title="-Dcom.ibm.gpu.enable" class="md-nav__link">
-Dcom.ibm.gpu.enable
</a>
</li>
<li class="md-nav__item">
<a href="../dcomibmgpuverbose/" title="-Dcom.ibm.gpu.verbose" class="md-nav__link">
-Dcom.ibm.gpu.verbose
</a>
</li>
<li class="md-nav__item">
<a href="../dcomibmlangmanagementosmxbeaniscputime100ns/" title="-Dcom.ibm.lang.management.OperatingSystemMXBean.isCpuTime100ns" class="md-nav__link">
-Dcom.ibm.lang.management.OperatingSystemMXBean.isCpuTime100ns
</a>
</li>
<li class="md-nav__item">
<a href="../dcomibmlangmanagementverbose/" title="-Dcom.ibm.lang.management.verbose" class="md-nav__link">
-Dcom.ibm.lang.management.verbose
</a>
</li>
<li class="md-nav__item">
<a href="../dcomibmtoolsattachcommand_timeout/" title="-Dcom.ibm.tools.attach.command_timeout" class="md-nav__link">
-Dcom.ibm.tools.attach.command_timeout
</a>
</li>
<li class="md-nav__item">
<a href="../dcomibmtoolsattachdirectory/" title="-Dcom.ibm.tools.attach.directory" class="md-nav__link">
-Dcom.ibm.tools.attach.directory
</a>
</li>
<li class="md-nav__item">
<a href="../dcomibmtoolsattachdisplayname/" title="-Dcom.ibm.tools.attach.displayName" class="md-nav__link">
-Dcom.ibm.tools.attach.displayName
</a>
</li>
<li class="md-nav__item">
<a href="../dcomibmtoolsattachenable/" title="-Dcom.ibm.tools.attach.enable" class="md-nav__link">
-Dcom.ibm.tools.attach.enable
</a>
</li>
<li class="md-nav__item">
<a href="../dcomibmtoolsattachid/" title="-Dcom.ibm.tools.attach.id" class="md-nav__link">
-Dcom.ibm.tools.attach.id
</a>
</li>
<li class="md-nav__item">
<a href="../dcomibmtoolsattachlogging/" title="-Dcom.ibm.tools.attach.logging" class="md-nav__link">
-Dcom.ibm.tools.attach.logging
</a>
</li>
<li class="md-nav__item">
<a href="../dcomibmtoolsattachlogname/" title="-Dcom.ibm.tools.attach.log.name" class="md-nav__link">
-Dcom.ibm.tools.attach.log.name
</a>
</li>
<li class="md-nav__item">
<a href="../dcomibmtoolsattachshutdown_timeout/" title="-Dcom.ibm.tools.attach.shutdown_timeout" class="md-nav__link">
-Dcom.ibm.tools.attach.shutdown_timeout
</a>
</li>
<li class="md-nav__item">
<a href="../dcomibmtoolsattachtimeout/" title="-Dcom.ibm.tools.attach.timeout" class="md-nav__link">
-Dcom.ibm.tools.attach.timeout
</a>
</li>
<li class="md-nav__item">
<a href="../dfileencoding/" title="-Dfile.encoding" class="md-nav__link">
-Dfile.encoding
</a>
</li>
<li class="md-nav__item">
<a href="../djavacompiler/" title="-Djava.compiler" class="md-nav__link">
-Djava.compiler
</a>
</li>
<li class="md-nav__item">
<a href="../djavalangstringsubstringnocopy/" title="-Djava.lang.string.substring.nocopy" class="md-nav__link">
-Djava.lang.string.substring.nocopy
</a>
</li>
<li class="md-nav__item">
<a href="../djavalangstringbuffergrowaggressively/" title="-Djava.lang.stringBuffer.growAggressively" class="md-nav__link">
-Djava.lang.stringBuffer.growAggressively
</a>
</li>
<li class="md-nav__item">
<a href="../djdknativecbc/" title="-Djdk.nativeCBC" class="md-nav__link">
-Djdk.nativeCBC
</a>
</li>
<li class="md-nav__item">
<a href="../djdknativechacha20/" title="-Djdk.nativeChaCha20" class="md-nav__link">
-Djdk.nativeChaCha20
</a>
</li>
<li class="md-nav__item">
<a href="../djdknativecrypto/" title="-Djdk.nativeCrypto" class="md-nav__link">
-Djdk.nativeCrypto
</a>
</li>
<li class="md-nav__item">
<a href="../djdknativedigest/" title="-Djdk.nativeDigest" class="md-nav__link">
-Djdk.nativeDigest
</a>
</li>
<li class="md-nav__item">
<a href="../djdknativegcm/" title="-Djdk.nativeGCM" class="md-nav__link">
-Djdk.nativeGCM
</a>
</li>
<li class="md-nav__item">
<a href="../djdknativersa/" title="-Djdk.nativeRSA" class="md-nav__link">
-Djdk.nativeRSA
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-toggle md-nav__toggle" data-md-toggle="nav-13-5" type="checkbox" id="nav-13-5">
<label class="md-nav__link" for="nav-13-5">
JVM -X options
</label>
<nav class="md-nav" data-md-component="collapsible" data-md-level="2">
<label class="md-nav__title" for="nav-13-5">
JVM -X options
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../x_jvm_commands/" title="Using -X options" class="md-nav__link">
Using -X options
</a>
</li>
<li class="md-nav__item">
<a href="../x/" title="-X" class="md-nav__link">
-X
</a>
</li>
<li class="md-nav__item">
<a href="../xaggressive/" title="-Xaggressive" class="md-nav__link">
-Xaggressive
</a>
</li>
<li class="md-nav__item">
<a href="../xalwaysclassgc/" title="-Xalwaysclassgc" class="md-nav__link">
-Xalwaysclassgc
</a>
</li>
<li class="md-nav__item">
<a href="../xaot/" title="-Xaot" class="md-nav__link">
-Xaot
</a>
</li>
<li class="md-nav__item">
<a href="../xargencoding/" title="-Xargencoding" class="md-nav__link">
-Xargencoding
</a>
</li>
<li class="md-nav__item">
<a href="../xbootclasspath/" title="-Xbootclasspath" class="md-nav__link">
-Xbootclasspath
</a>
</li>
<li class="md-nav__item">
<a href="../xceehdlr/" title="-XCEEHDLR" class="md-nav__link">
-XCEEHDLR
</a>
</li>
<li class="md-nav__item">
<a href="../xcheck/" title="-Xcheck" class="md-nav__link">
-Xcheck
</a>
</li>
<li class="md-nav__item">
<a href="../xclassgc/" title="-Xclassgc" class="md-nav__link">
-Xclassgc
</a>
</li>
<li class="md-nav__item">
<a href="../xcodecache/" title="-Xcodecache" class="md-nav__link">
-Xcodecache
</a>
</li>
<li class="md-nav__item">
<a href="../xcodecachetotal/" title="-Xcodecachetotal" class="md-nav__link">
-Xcodecachetotal
</a>
</li>
<li class="md-nav__item">
<a href="../xcomp/" title="-Xcomp" class="md-nav__link">
-Xcomp
</a>
</li>
<li class="md-nav__item">
<a href="../xcompactexplicitgc/" title="-Xcompactexplicitgc" class="md-nav__link">
-Xcompactexplicitgc
</a>
</li>
<li class="md-nav__item">
<a href="../xcompactgc/" title="-Xcompactgc" class="md-nav__link">
-Xcompactgc
</a>
</li>
<li class="md-nav__item">
<a href="../xcompilationthreads/" title="-XcompilationThreads" class="md-nav__link">
-XcompilationThreads
</a>
</li>
<li class="md-nav__item">
<a href="../xcompressedrefs/" title="-Xcompressedrefs" class="md-nav__link">
-Xcompressedrefs
</a>
</li>
<li class="md-nav__item">
<a href="../xconcurrentbackground/" title="-Xconcurrentbackground" class="md-nav__link">
-Xconcurrentbackground
</a>
</li>
<li class="md-nav__item">
<a href="../xconcurrentlevel/" title="-Xconcurrentlevel" class="md-nav__link">
-Xconcurrentlevel
</a>
</li>
<li class="md-nav__item">
<a href="../xconcurrentslack/" title="-Xconcurrentslack" class="md-nav__link">
-Xconcurrentslack
</a>
</li>
<li class="md-nav__item">
<a href="../xconmeter/" title="-Xconmeter" class="md-nav__link">
-Xconmeter
</a>
</li>
<li class="md-nav__item">
<a href="../xenableexcessivegc/" title="-Xdisableexcessivegc" class="md-nav__link">
-Xdisableexcessivegc
</a>
</li>
<li class="md-nav__item">
<a href="../xenableexplicitgc/" title="-Xdisableexplicitgc" class="md-nav__link">
-Xdisableexplicitgc
</a>
</li>
<li class="md-nav__item">
<a href="../xdisablejavadump/" title="-Xdisablejavadump" class="md-nav__link">
-Xdisablejavadump
</a>
</li>
<li class="md-nav__item">
<a href="../xenablestringconstantgc/" title="-Xdisablestringconstantgc" class="md-nav__link">
-Xdisablestringconstantgc
</a>
</li>
<li class="md-nav__item">
<a href="../xdump/" title="-Xdump" class="md-nav__link">
-Xdump
</a>
</li>
<li class="md-nav__item">
<a href="../xenableexcessivegc/" title="-Xenableexcessivegc" class="md-nav__link">
-Xenableexcessivegc
</a>
</li>
<li class="md-nav__item">
<a href="../xenableexplicitgc/" title="-Xenableexplicitgc" class="md-nav__link">
-Xenableexplicitgc
</a>
</li>
<li class="md-nav__item">
<a href="../xenablestringconstantgc/" title="-Xenablestringconstantgc" class="md-nav__link">
-Xenablestringconstantgc
</a>
</li>
<li class="md-nav__item">
<a href="../xfastresolve/" title="-Xfastresolve" class="md-nav__link">
-Xfastresolve
</a>
</li>
<li class="md-nav__item">
<a href="../xfuture/" title="-Xfuture" class="md-nav__link">
-Xfuture
</a>
</li>
<li class="md-nav__item">
<a href="../xgc/" title="-Xgc" class="md-nav__link">
-Xgc
</a>
</li>
<li class="md-nav__item">
<a href="../xgcsplitheap/" title="-Xgc:splitheap" class="md-nav__link">
-Xgc:splitheap
</a>
</li>
<li class="md-nav__item">
<a href="../xgcpolicy/" title="-Xgcpolicy" class="md-nav__link">
-Xgcpolicy
</a>
</li>
<li class="md-nav__item">
<a href="../xgcthreads/" title="-Xgcthreads" class="md-nav__link">
-Xgcthreads
</a>
</li>
<li class="md-nav__item">
<a href="../xgcworkpackets/" title="-Xgcworkpackets" class="md-nav__link">
-Xgcworkpackets
</a>
</li>
<li class="md-nav__item">
<a href="../xint/" title="-Xint" class="md-nav__link">
-Xint
</a>
</li>
<li class="md-nav__item">
<a href="../xss/" title="-Xiss" class="md-nav__link">
-Xiss
</a>
</li>
<li class="md-nav__item">
<a href="../xjit/" title="-Xjit" class="md-nav__link">
-Xjit
</a>
</li>
<li class="md-nav__item">
<a href="../xjni/" title="-Xjni" class="md-nav__link">
-Xjni
</a>
</li>
<li class="md-nav__item">
<a href="../xlinenumbers/" title="-Xlinenumbers" class="md-nav__link">
-Xlinenumbers
</a>
</li>
<li class="md-nav__item">
<a href="../xloa/" title="-Xloa" class="md-nav__link">
-Xloa
</a>
</li>
<li class="md-nav__item">
<a href="../xloaminimum/" title="-Xloainitial" class="md-nav__link">
-Xloainitial
</a>
</li>
<li class="md-nav__item">
<a href="../xloaminimum/" title="-Xloamaximum" class="md-nav__link">
-Xloamaximum
</a>
</li>
<li class="md-nav__item">
<a href="../xloaminimum/" title="-Xloaminimum" class="md-nav__link">
-Xloaminimum
</a>
</li>
<li class="md-nav__item">
<a href="../xlockreservation/" title="-XlockReservation" class="md-nav__link">
-XlockReservation
</a>
</li>
<li class="md-nav__item">
<a href="../xlockword/" title="-Xlockword" class="md-nav__link">
-Xlockword
</a>
</li>
<li class="md-nav__item">
<a href="../xlog/" title="-Xlog" class="md-nav__link">
-Xlog
</a>
</li>
<li class="md-nav__item">
<a href="../xlp/" title="-Xlp" class="md-nav__link">
-Xlp
</a>
</li>
<li class="md-nav__item">
<a href="../xlpcodecache/" title="-Xlp:codecache" class="md-nav__link">
-Xlp:codecache
</a>
</li>
<li class="md-nav__item">
<a href="../xlpobjectheap/" title="-Xlp:objectheap" class="md-nav__link">
-Xlp:objectheap
</a>
</li>
<li class="md-nav__item">
<a href="../xmine/" title="-Xmaxe" class="md-nav__link">
-Xmaxe
</a>
</li>
<li class="md-nav__item">
<a href="../xminf/" title="-Xmaxf" class="md-nav__link">
-Xmaxf
</a>
</li>
<li class="md-nav__item">
<a href="../xmint/" title="-Xmaxt" class="md-nav__link">
-Xmaxt
</a>
</li>
<li class="md-nav__item">
<a href="../xmca/" title="-Xmca" class="md-nav__link">
-Xmca
</a>
</li>
<li class="md-nav__item">
<a href="../xmca/" title="-Xmco" class="md-nav__link">
-Xmco
</a>
</li>
<li class="md-nav__item">
<a href="../xmcrs/" title="-Xmcrs" class="md-nav__link">
-Xmcrs
</a>
</li>
<li class="md-nav__item">
<a href="../xmine/" title="-Xmine" class="md-nav__link">
-Xmine
</a>
</li>
<li class="md-nav__item">
<a href="../xminf/" title="-Xminf" class="md-nav__link">
-Xminf
</a>
</li>
<li class="md-nav__item">
<a href="../xmint/" title="-Xmint" class="md-nav__link">
-Xmint
</a>
</li>
<li class="md-nav__item">
<a href="../xmn/" title="-Xmn" class="md-nav__link">
-Xmn
</a>
</li>
<li class="md-nav__item">
<a href="../xmn/" title="-Xmns" class="md-nav__link">
-Xmns
</a>
</li>
<li class="md-nav__item">
<a href="../xmn/" title="-Xmnx" class="md-nav__link">
-Xmnx
</a>
</li>
<li class="md-nav__item">
<a href="../xmo/" title="-Xmo" class="md-nav__link">
-Xmo
</a>
</li>
<li class="md-nav__item">
<a href="../xmo/" title="-Xmoi" class="md-nav__link">
-Xmoi
</a>
</li>
<li class="md-nav__item">
<a href="../xmo/" title="-Xmos" class="md-nav__link">
-Xmos
</a>
</li>
<li class="md-nav__item">
<a href="../xmo/" title="-Xmox" class="md-nav__link">
-Xmox
</a>
</li>
<li class="md-nav__item">
<a href="../xmr/" title="-Xmr" class="md-nav__link">
-Xmr
</a>
</li>
<li class="md-nav__item">
<a href="../xmr/" title="-Xmrx" class="md-nav__link">
-Xmrx
</a>
</li>
<li class="md-nav__item">
<a href="../xms/" title="-Xms" class="md-nav__link">
-Xms
</a>
</li>
<li class="md-nav__item">
<a href="../xmso/" title="-Xmso" class="md-nav__link">
-Xmso
</a>
</li>
<li class="md-nav__item">
<a href="../xms/" title="-Xmx" class="md-nav__link">
-Xmx
</a>
</li>
<li class="md-nav__item">
<a href="../xaot/" title="-Xnoaot" class="md-nav__link">
-Xnoaot
</a>
</li>
<li class="md-nav__item">
<a href="../xclassgc/" title="-Xnoclassgc" class="md-nav__link">
-Xnoclassgc
</a>
</li>
<li class="md-nav__item">
<a href="../xcompactexplicitgc/" title="-Xnocompactexplicitgc" class="md-nav__link">
-Xnocompactexplicitgc
</a>
</li>
<li class="md-nav__item">
<a href="../xcompactgc/" title="-Xnocompactgc" class="md-nav__link">
-Xnocompactgc
</a>
</li>
<li class="md-nav__item">
<a href="../xcompressedrefs/" title="-Xnocompressedrefs" class="md-nav__link">
-Xnocompressedrefs
</a>
</li>
<li class="md-nav__item">
<a href="../xjit/" title="-Xnojit" class="md-nav__link">
-Xnojit
</a>
</li>
<li class="md-nav__item">
<a href="../xlinenumbers/" title="-Xnolinenumbers" class="md-nav__link">
-Xnolinenumbers
</a>
</li>
<li class="md-nav__item">
<a href="../xloa/" title="-Xnoloa" class="md-nav__link">
-Xnoloa
</a>
</li>
<li class="md-nav__item">
<a href="../xsigcatch/" title="-Xnosigcatch" class="md-nav__link">
-Xnosigcatch
</a>
</li>
<li class="md-nav__item">
<a href="../xsigchain/" title="-Xnosigchain" class="md-nav__link">
-Xnosigchain
</a>
</li>
<li class="md-nav__item">
<a href="../xnumanone/" title="-Xnuma:none" class="md-nav__link">
-Xnuma:none
</a>
</li>
<li class="md-nav__item">
<a href="../xoptionsfile/" title="-Xoptionsfile" class="md-nav__link">
-Xoptionsfile
</a>
</li>
<li class="md-nav__item">
<a href="../xquickstart/" title="-Xquickstart" class="md-nav__link">
-Xquickstart
</a>
</li>
<li class="md-nav__item">
<a href="../xrs/" title="-Xrs" class="md-nav__link">
-Xrs
</a>
</li>
<li class="md-nav__item">
<a href="../xsamplingexpirationtime/" title="-XsamplingExpirationTime" class="md-nav__link">
-XsamplingExpirationTime
</a>
</li>
<li class="md-nav__item">
<a href="../xscdmx/" title="-Xscdmx" class="md-nav__link">
-Xscdmx
</a>
</li>
<li class="md-nav__item">
<a href="../xscminaot/" title="-Xscmaxaot" class="md-nav__link">
-Xscmaxaot
</a>
</li>
<li class="md-nav__item">
<a href="../xscminjitdata/" title="-Xscmaxjitdata" class="md-nav__link">
-Xscmaxjitdata
</a>
</li>
<li class="md-nav__item">
<a href="../xscminaot/" title="-Xscminaot" class="md-nav__link">
-Xscminaot
</a>
</li>
<li class="md-nav__item">
<a href="../xscminjitdata/" title="-Xscminjitdata" class="md-nav__link">
-Xscminjitdata
</a>
</li>
<li class="md-nav__item">
<a href="../xscmx/" title="-Xscmx" class="md-nav__link">
-Xscmx
</a>
</li>
<li class="md-nav__item">
<a href="../xshareclasses/" title="-Xshareclasses" class="md-nav__link">
-Xshareclasses
</a>
</li>
<li class="md-nav__item">
<a href="../xsigcatch/" title="-Xsigcatch" class="md-nav__link">
-Xsigcatch
</a>
</li>
<li class="md-nav__item">
<a href="../xsigchain/" title="-Xsigchain" class="md-nav__link">
-Xsigchain
</a>
</li>
<li class="md-nav__item">
<a href="../xsignal/" title="-Xsignal" class="md-nav__link">
-Xsignal
</a>
</li>
<li class="md-nav__item">
<a href="../xsoftmx/" title="-Xsoftmx" class="md-nav__link">
-Xsoftmx
</a>
</li>
<li class="md-nav__item">
<a href="../xsoftrefthreshold/" title="-Xsoftrefthreshold" class="md-nav__link">
-Xsoftrefthreshold
</a>
</li>
<li class="md-nav__item">
<a href="../xss/" title="-Xss" class="md-nav__link">
-Xss
</a>
</li>
<li class="md-nav__item">
<a href="../xss/" title="-Xssi" class="md-nav__link">
-Xssi
</a>
</li>
<li class="md-nav__item">
<a href="../xsyslog/" title="-Xsyslog" class="md-nav__link">
-Xsyslog
</a>
</li>
<li class="md-nav__item">
<a href="../xtgc/" title="-Xtgc" class="md-nav__link">
-Xtgc
</a>
</li>
<li class="md-nav__item">
<a href="../xthr/" title="-Xthr" class="md-nav__link">
-Xthr
</a>
</li>
<li class="md-nav__item">
<a href="../xtlhprefetch/" title="-XtlhPrefetch" class="md-nav__link">
-XtlhPrefetch
</a>
</li>
<li class="md-nav__item">
<a href="../xtrace/" title="-Xtrace" class="md-nav__link">
-Xtrace
</a>
</li>
<li class="md-nav__item">
<a href="../xtunevirtualized/" title="-Xtune:virtualized" class="md-nav__link">
-Xtune:virtualized
</a>
</li>
<li class="md-nav__item">
<a href="../xverbosegclog/" title="-Xverbosegclog" class="md-nav__link">
-Xverbosegclog
</a>
</li>
<li class="md-nav__item">
<a href="../xverify/" title="-Xverify" class="md-nav__link">
-Xverify
</a>
</li>
<li class="md-nav__item">
<a href="../xzero/" title="-Xzero" class="md-nav__link">
-Xzero
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-toggle md-nav__toggle" data-md-toggle="nav-13-6" type="checkbox" id="nav-13-6">
<label class="md-nav__link" for="nav-13-6">
JVM -XX options
</label>
<nav class="md-nav" data-md-component="collapsible" data-md-level="2">
<label class="md-nav__title" for="nav-13-6">
JVM -XX options
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../xx_jvm_commands/" title="Using -XX options" class="md-nav__link">
Using -XX options
</a>
</li>
<li class="md-nav__item">
<a href="../xxactiveprocessorcount/" title="-XXActiveProcessorCount" class="md-nav__link">
-XXActiveProcessorCount
</a>
</li>
<li class="md-nav__item">
<a href="../xxallowvmshutdown/" title="-XXallowvmshutdown" class="md-nav__link">
-XXallowvmshutdown
</a>
</li>
<li class="md-nav__item">
<a href="../xxalwayspretouch/" title="-XX:[+|-]AlwaysPreTouch" class="md-nav__link">
-XX:[+|-]AlwaysPreTouch
</a>
</li>
<li class="md-nav__item">
<a href="../xxclassrelationshipverifier/" title="-XX:[+|-]ClassRelationshipVerifier" class="md-nav__link">
-XX:[+|-]ClassRelationshipVerifier
</a>
</li>
<li class="md-nav__item">
<a href="../xxconcgcthreads/" title="-XX:ConcGCThreads" class="md-nav__link">
-XX:ConcGCThreads
</a>
</li>
<li class="md-nav__item">
<a href="../xxcodecachetotal/" title="-XX:codecachetotal" class="md-nav__link">
-XX:codecachetotal
</a>
</li>
<li class="md-nav__item">
<a href="../xxcompactstrings/" title="-XX:[+|-]CompactStrings" class="md-nav__link">
-XX:[+|-]CompactStrings
</a>
</li>
<li class="md-nav__item">
<a href="../xxdiagnosesynconvaluebasedclasses/" title="-XX:DiagnoseSyncOnValueBasedClasses" class="md-nav__link">
-XX:DiagnoseSyncOnValueBasedClasses
</a>
</li>
<li class="md-nav__item">
<a href="../xxdisableexplicitgc/" title="-XX:[+|-]DisableExplicitGC" class="md-nav__link">
-XX:[+|-]DisableExplicitGC
</a>
</li>
<li class="md-nav__item">
<a href="../xxdisclaimjitscratch/" title="-XX:[+|-]DisclaimJitScratch" class="md-nav__link">
-XX:[+|-]DisclaimJitScratch
</a>
</li>
<li class="md-nav__item">
<a href="../xxenablecpumonitor/" title="-XX:[+|-]EnableCPUMonitor" class="md-nav__link">
-XX:[+|-]EnableCPUMonitor
</a>
</li>
<li class="md-nav__item">
<a href="../xxexitonoutofmemoryerror/" title="-XX:[+|-]ExitOnOutOfMemoryError" class="md-nav__link">
-XX:[+|-]ExitOnOutOfMemoryError
</a>
</li>
<li class="md-nav__item">
<a href="../xxgloballockreservation/" title="-XX:[+|-]GlobalLockReservation" class="md-nav__link">
-XX:[+|-]GlobalLockReservation
</a>
</li>
<li class="md-nav__item">
<a href="../xxhandlesigxfsz/" title="-XX:[+|-]HandleSIGXFSZ" class="md-nav__link">
-XX:[+|-]HandleSIGXFSZ
</a>
</li>
<li class="md-nav__item">
<a href="../xxhandlesigabrt/" title="-XX:[+|-]HandleSIGABRT" class="md-nav__link">
-XX:[+|-]HandleSIGABRT
</a>
</li>
<li class="md-nav__item">
<a href="../xxheapdumponoutofmemory/" title="-XX:[+|-]HeapDumpOnOutOfMemory" class="md-nav__link">
-XX:[+|-]HeapDumpOnOutOfMemory
</a>
</li>
<li class="md-nav__item">
<a href="../xxheapdumppath/" title="-XX:HeapDumpPath" class="md-nav__link">
-XX:HeapDumpPath
</a>
</li>
<li class="md-nav__item">
<a href="../xxheapmanagementmxbeancompatibility/" title="-XX:[+|-]HeapManagementMXBeanCompatibility" class="md-nav__link">
-XX:[+|-]HeapManagementMXBeanCompatibility
</a>
</li>
<li class="md-nav__item">
<a href="../xxidletuningcompactonidle/" title="-XX:[+|-]IdleTuningCompactOnIdle" class="md-nav__link">
-XX:[+|-]IdleTuningCompactOnIdle
</a>
</li>
<li class="md-nav__item">
<a href="../xxidletuninggconidle/" title="-XX:[+|-]IdleTuningGcOnIdle" class="md-nav__link">
-XX:[+|-]IdleTuningGcOnIdle
</a>
</li>
<li class="md-nav__item">
<a href="../xxidletuningminfreeheaponidle/" title="-XX:IdleTuningMinFreeHeapOnIdle" class="md-nav__link">
-XX:IdleTuningMinFreeHeapOnIdle
</a>
</li>
<li class="md-nav__item">
<a href="../xxidletuningminidlewaittime/" title="-XX:IdleTuningMinIdleWaitTime" class="md-nav__link">
-XX:IdleTuningMinIdleWaitTime
</a>
</li>
<li class="md-nav__item">
<a href="../xxignoreunrecognizedvmoptions/" title="-XX:[+|-]IgnoreUnrecognizedVMOptions" class="md-nav__link">
-XX:[+|-]IgnoreUnrecognizedVMOptions
</a>
</li>
<li class="md-nav__item">
<a href="../xxignoreunrecognizedxxcolonoptions/" title="-XX:[+|-]IgnoreUnrecognizedXXColonOptions" class="md-nav__link">
-XX:[+|-]IgnoreUnrecognizedXXColonOptions
</a>
</li>
<li class="md-nav__item">
<a href="../xxinitialrampercentage/" title="-XX:InitialRAMPercentage" class="md-nav__link">
-XX:InitialRAMPercentage
</a>
</li>
<li class="md-nav__item">
<a href="../xxinitialheapsize/" title="-XX:InitialHeapSize" class="md-nav__link">
-XX:InitialHeapSize
</a>
</li>
<li class="md-nav__item">
<a href="../xxinterleavememory/" title="-XX:[+|-]InterleaveMemory" class="md-nav__link">
-XX:[+|-]InterleaveMemory
</a>
</li>
<li class="md-nav__item">
<a href="../xxjitinlinewatches/" title="-XX:[+|-]JITInlineWatches" class="md-nav__link">
-XX:[+|-]JITInlineWatches
</a>
</li>
<li class="md-nav__item">
<a href="../xxlazysymbolresolution/" title="-XX:[+|-]LazySymbolResolution" class="md-nav__link">
-XX:[+|-]LazySymbolResolution
</a>
</li>
<li class="md-nav__item">
<a href="../xxlegacyxlogoption/" title="-XX:[+|-]LegacyXLogOption" class="md-nav__link">
-XX:[+|-]LegacyXLogOption
</a>
</li>
<li class="md-nav__item">
<a href="../xxmaxdirectmemorysize/" title="-XX:MaxDirectMemorySize" class="md-nav__link">
-XX:MaxDirectMemorySize
</a>
</li>
<li class="md-nav__item">
<a href="../xxinitialheapsize/" title="-XX:MaxHeapSize" class="md-nav__link">
-XX:MaxHeapSize
</a>
</li>
<li class="md-nav__item">
<a href="../xxinitialrampercentage/" title="-XX:MaxRAMPercentage" class="md-nav__link">
-XX:MaxRAMPercentage
</a>
</li>
<li class="md-nav__item">
<a href="../xxonoutofmemoryerror/" title="-XX:OnOutOfMemoryError" class="md-nav__link">
-XX:OnOutOfMemoryError
</a>
</li>
<li class="md-nav__item">
<a href="../xxoriginaljdk8heapsizecompatibilitymode/" title="-XX:[+|-]OriginalJDK8HeapSizeCompatibilityMode" class="md-nav__link">
-XX:[+|-]OriginalJDK8HeapSizeCompatibilityMode
</a>
</li>
<li class="md-nav__item">
<a href="../xxnosuballoc32bitmem/" title="-XXnosuballoc32bitmem" class="md-nav__link">
-XXnosuballoc32bitmem
</a>
</li>
<li class="md-nav__item">
<a href="../xxpagealigndirectmemory/" title="-XX:[+|-]PageAlignDirectMemory" class="md-nav__link">
-XX:[+|-]PageAlignDirectMemory
</a>
</li>
<li class="md-nav__item">
<a href="../xxparallelcmsthreads/" title="-XX:ParallelCMSThreads" class="md-nav__link">
-XX:ParallelCMSThreads
</a>
</li>
<li class="md-nav__item">
<a href="../xxparallelgcthreads/" title="-XX:ParallelGCThreads" class="md-nav__link">
-XX:ParallelGCThreads
</a>
</li>
<li class="md-nav__item">
<a href="../xxportablesharedcache/" title="-XX:[+|-]PortableSharedCache" class="md-nav__link">
-XX:[+|-]PortableSharedCache
</a>
</li>
<li class="md-nav__item">
<a href="../xxpositiveidentityhash/" title="-XX:[+|-]PositiveIdentityHash" class="md-nav__link">
-XX:[+|-]PositiveIdentityHash
</a>
</li>
<li class="md-nav__item">
<a href="../xxprintcodecache/" title="-XX:[+|-]PrintCodeCache" class="md-nav__link">
-XX:[+|-]PrintCodeCache
</a>
</li>
<li class="md-nav__item">
<a href="../xxprintflagsfinal/" title="-XX:[+|-]PrintFlagsFinal" class="md-nav__link">
-XX:[+|-]PrintFlagsFinal
</a>
</li>
<li class="md-nav__item">
<a href="../xxreadipinfoforras/" title="-XX:[+|-]ReadIPInfoForRAS" class="md-nav__link">
-XX:[+|-]ReadIPInfoForRAS
</a>
</li>
<li class="md-nav__item">
<a href="../xxreducecpumonitoroverhead/" title="-XX:[+|-]ReduceCPUMonitorOverhead" class="md-nav__link">
-XX:[+|-]ReduceCPUMonitorOverhead
</a>
</li>
<li class="md-nav__item">
<a href="../xxruntimeinstrumentation/" title="-XX:[+|-]RuntimeInstrumentation" class="md-nav__link">
-XX:[+|-]RuntimeInstrumentation
</a>
</li>
<li class="md-nav__item">
<a href="../xxsethwprefetch/" title="-XXsetHWPrefetch" class="md-nav__link">
-XXsetHWPrefetch
</a>
</li>
<li class="md-nav__item">
<a href="../xxshareanonymousclasses/" title="-XX:[+|-]ShareAnonymousClasses" class="md-nav__link">
-XX:[+|-]ShareAnonymousClasses
</a>
</li>
<li class="md-nav__item">
<a href="../xxshareclassesenablebci/" title="-XX:ShareClassesDisableBCI" class="md-nav__link">
-XX:ShareClassesDisableBCI
</a>
</li>
<li class="md-nav__item">
<a href="../xxshareclassesenablebci/" title="-XX:ShareClassesEnableBCI" class="md-nav__link">
-XX:ShareClassesEnableBCI
</a>
</li>
<li class="md-nav__item">
<a href="../xxsharedcachehardlimit/" title="-XX:SharedCacheHardLimit" class="md-nav__link">
-XX:SharedCacheHardLimit
</a>
</li>
<li class="md-nav__item">
<a href="../xxshareunsafeclasses/" title="-XX:[+|-]ShareUnsafeClasses" class="md-nav__link">
-XX:[+|-]ShareUnsafeClasses
</a>
</li>
<li class="md-nav__item">
<a href="../xxstacktraceinthrowable/" title="-XX:-StackTraceInThrowable" class="md-nav__link">
-XX:-StackTraceInThrowable
</a>
</li>
<li class="md-nav__item">
<a href="../xxtransparenthugepage/" title="-XX:[+|-]TransparentHugePage" class="md-nav__link">
-XX:[+|-]TransparentHugePage
</a>
</li>
<li class="md-nav__item">
<a href="../xxusecompressedoops/" title="-XX:[+|-]UseCompressedOops" class="md-nav__link">
-XX:[+|-]UseCompressedOops
</a>
</li>
<li class="md-nav__item">
<a href="../xxusecontainersupport/" title="-XX:[+|-]UseContainerSupport" class="md-nav__link">
-XX:[+|-]UseContainerSupport
</a>
</li>
<li class="md-nav__item">
<a href="../xxusegcstartuphints/" title="-XX:[+|-]UseGCStartupHints" class="md-nav__link">
-XX:[+|-]UseGCStartupHints
</a>
</li>
<li class="md-nav__item">
<a href="../xxusenogc/" title="-XX:[+|-]UseNoGC" class="md-nav__link">
-XX:[+|-]UseNoGC
</a>
</li>
<li class="md-nav__item">
<a href="../xxverboseverification/" title="-XX:[+|-]VerboseVerification" class="md-nav__link">
-XX:[+|-]VerboseVerification
</a>
</li>
<li class="md-nav__item">
<a href="../xxvmlockclassloader/" title="-XX:[+|-]VMLockClassLoader" class="md-nav__link">
-XX:[+|-]VMLockClassLoader
</a>
</li>
</ul>
</nav>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-toggle md-nav__toggle" data-md-toggle="nav-14" type="checkbox" id="nav-14">
<label class="md-nav__link" for="nav-14">
Reference
</label>
<nav class="md-nav" data-md-component="collapsible" data-md-level="1">
<label class="md-nav__title" for="nav-14">
Reference
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../openj9_support/" title="Supported environments" class="md-nav__link">
Supported environments
</a>
</li>
<li class="md-nav__item">
<a href="../openj9_defaults/" title="Default settings" class="md-nav__link">
Default settings
</a>
</li>
<li class="md-nav__item">
<a href="../openj9_signals/" title="Signal handling" class="md-nav__link">
Signal handling
</a>
</li>
<li class="md-nav__item">
<a href="../openj9_directories/" title="Directory conventions" class="md-nav__link">
Directory conventions
</a>
</li>
<li class="md-nav__item">
<a href="../messages_intro/" title="OpenJ9 messages" class="md-nav__link">
OpenJ9 messages
</a>
</li>
<li class="md-nav__item">
<a href="../env_var/" title="Environment variables" class="md-nav__link">
Environment variables
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-toggle md-nav__toggle" data-md-toggle="nav-15" type="checkbox" id="nav-15">
<label class="md-nav__link" for="nav-15">
API documentation
</label>
<nav class="md-nav" data-md-component="collapsible" data-md-level="1">
<label class="md-nav__title" for="nav-15">
API documentation
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../api-overview/" title="Overview" class="md-nav__link">
Overview
</a>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-toggle md-nav__toggle" data-md-toggle="nav-15-2" type="checkbox" id="nav-15-2">
<label class="md-nav__link" for="nav-15-2">
Java 8 API
</label>
<nav class="md-nav" data-md-component="collapsible" data-md-level="2">
<label class="md-nav__title" for="nav-15-2">
Java 8 API
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../api-conditionhandling/" title="Condition exception handling" class="md-nav__link">
Condition exception handling
</a>
</li>
<li class="md-nav__item">
<a href="../api-cuda/" title="CUDA4J" class="md-nav__link">
CUDA4J
</a>
</li>
<li class="md-nav__item">
<a href="../api-daa/" title="Data access acceleration" class="md-nav__link">
Data access acceleration
</a>
</li>
<li class="md-nav__item">
<a href="../api-dtfj/" title="DTFJ" class="md-nav__link">
DTFJ
</a>
</li>
<li class="md-nav__item">
<a href="../api-gpu/" title="GPU" class="md-nav__link">
GPU
</a>
</li>
<li class="md-nav__item">
<a href="../api-jvm/" title="JVM diagnostic utilities" class="md-nav__link">
JVM diagnostic utilities
</a>
</li>
<li class="md-nav__item">
<a href="../api-langmgmt/" title="Monitoring and management" class="md-nav__link">
Monitoring and management
</a>
</li>
<li class="md-nav__item">
<a href="../api-shrc/" title="Shared classes" class="md-nav__link">
Shared classes
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="../api-jdk11/" title="Java 11 API" class="md-nav__link">
Java 11 API
</a>
</li>
<li class="md-nav__item">
<a href="../api-jdk16/" title="Java 16 API" class="md-nav__link">
Java 16 API
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="../legal/" title="Legal" class="md-nav__link">
Legal
</a>
</li>
</ul>
</nav>
</div>
</div>
</div>
<div class="md-sidebar md-sidebar--secondary" data-md-component="toc">
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
<nav class="md-nav md-nav--secondary">
<label class="md-nav__title" for="__toc">On this page ...</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="#overview" class="md-nav__link">
Overview
</a>
</li>
<li class="md-nav__item">
<a href="#openj9-extensions" class="md-nav__link">
OpenJ9 extensions
</a>
</li>
<li class="md-nav__item">
<a href="#sample-jvmti-agent" class="md-nav__link">
Sample JVMTI agent
</a>
<nav class="md-nav">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#agent_onload" class="md-nav__link">
Agent_OnLoad()
</a>
</li>
<li class="md-nav__item">
<a href="#dumpstartcallback" class="md-nav__link">
DumpStartCallback()
</a>
</li>
<li class="md-nav__item">
<a href="#using-the-sample-jvmti-agent" class="md-nav__link">
Using the sample JVMTI agent
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#api-reference" class="md-nav__link">
API reference
</a>
<nav class="md-nav">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#getosthreadid" class="md-nav__link">
GetOSThreadID
</a>
</li>
<li class="md-nav__item">
<a href="#queryvmdump" class="md-nav__link">
QueryVmDump
</a>
</li>
<li class="md-nav__item">
<a href="#setvmdump" class="md-nav__link">
SetVmDump
</a>
</li>
<li class="md-nav__item">
<a href="#triggervmdump" class="md-nav__link">
TriggerVmDump
</a>
</li>
<li class="md-nav__item">
<a href="#resetvmdump" class="md-nav__link">
ResetVmDump
</a>
</li>
<li class="md-nav__item">
<a href="#vmdumpstart" class="md-nav__link">
VMDumpStart
</a>
</li>
<li class="md-nav__item">
<a href="#vmdumpend" class="md-nav__link">
VMDumpEnd
</a>
</li>
<li class="md-nav__item">
<a href="#setvmtrace" class="md-nav__link">
SetVmTrace
</a>
</li>
<li class="md-nav__item">
<a href="#registertracepointsubscriber" class="md-nav__link">
RegisterTracePointSubscriber
</a>
<nav class="md-nav">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#jvmtitracesubscriber-function" class="md-nav__link">
jvmtiTraceSubscriber function
</a>
</li>
<li class="md-nav__item">
<a href="#jvmtitracealarm-function" class="md-nav__link">
jvmtiTraceAlarm function
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#deregistertracepointsubscriber" class="md-nav__link">
DeregisterTracePointSubscriber
</a>
</li>
<li class="md-nav__item">
<a href="#getmemorycategories" class="md-nav__link">
GetMemoryCategories
</a>
</li>
<li class="md-nav__item">
<a href="#queryvmlogoptions" class="md-nav__link">
QueryVmLogOptions
</a>
</li>
<li class="md-nav__item">
<a href="#setvmlogoptions" class="md-nav__link">
SetVmLogOptions
</a>
</li>
<li class="md-nav__item">
<a href="#iteratesharedcaches" class="md-nav__link">
IterateSharedCaches
</a>
<nav class="md-nav">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#jvmtiiteratesharedcachescallback-function" class="md-nav__link">
jvmtiIterateSharedCachesCallback function
</a>
</li>
<li class="md-nav__item">
<a href="#jvmtisharedcacheinfo-structure" class="md-nav__link">
jvmtiSharedCacheInfo structure
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#destroysharedcache" class="md-nav__link">
DestroySharedCache
</a>
</li>
<li class="md-nav__item">
<a href="#registerverbosegcsubscriber" class="md-nav__link">
RegisterVerboseGCSubscriber
</a>
<nav class="md-nav">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#jvmtiverbosegcsubscriber-function" class="md-nav__link">
jvmtiVerboseGCSubscriber function
</a>
</li>
<li class="md-nav__item">
<a href="#jvmtiverbosegcalarm-function" class="md-nav__link">
jvmtiVerboseGCAlarm function
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#deregisterverbosegcsubscriber" class="md-nav__link">
DeregisterVerboseGCSubscriber
</a>
</li>
</ul>
</nav>
</li>
</ul>
</nav>
</div>
</div>
</div>
<div class="md-content">
<article class="md-content__inner md-typeset">
<!-- this adds 'pencil' icon to H1 so that you can edit the page directly in GitHub
<a href="https://github.com/eclipse/openj9/edit/master/docs/interface_jvmti.md" title="Edit this page" class="md-icon md-content__icon">&#xE3C9;</a>
-->
<!--
* Copyright (c) 2017, 2021 IBM Corp. and others
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution and is available at
* https://www.eclipse.org/legal/epl-2.0/ or the Apache
* License, Version 2.0 which accompanies this distribution and
* is available at https://www.apache.org/licenses/LICENSE-2.0.
*
* This Source Code may also be made available under the
* following Secondary Licenses when the conditions for such
* availability set forth in the Eclipse Public License, v. 2.0
* are satisfied: GNU General Public License, version 2 with
* the GNU Classpath Exception [1] and GNU General Public
* License, version 2 with the OpenJDK Assembly Exception [2].
*
* [1] https://www.gnu.org/software/classpath/license.html
* [2] http://openjdk.java.net/legal/assembly-exception.html
*
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH
* Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception
-->
<h1 id="java-virtual-machine-tool-interface">Java Virtual Machine Tool Interface</h1>
<p>The Java&trade; Virtual Machine Tool Interface (JVMTI) is a two-way interface that allows communication between the VM and a native agent. It replaces both the Java Virtual Machine Debug Interface (JVMDI) and Java Virtual Machine Profiler Interface (JVMPI).</p>
<h2 id="overview">Overview</h2>
<p>The JVMTI allows third parties to develop debugging, profiling, and monitoring tools for the VM. The interface contains mechanisms for the agent to notify the VM about the kinds of information it requires, and also provides a means of receiving relevant notifications.</p>
<p>Several agents can be attached to a VM at any one time.</p>
<p>JVMTI agents can be loaded at startup using short or long forms of the command-line option:</p>
<pre><code>-agentlib:&lt;agent-lib-name&gt;=&lt;options&gt;
</code></pre>
<p>or</p>
<pre><code>-agentpath:&lt;path-to-agent&gt;=&lt;options&gt;
</code></pre>
<p>In the example that follows (see <a href="#sample-jvmti-agent">Sample JVMTI agent</a>), the directory containing the <code>jdwp</code> library is assumed to be on the library path. If you require a specific library, such as <code>jdwp</code>, with your JVMTI agent, you can specify the path at startup, for example:</p>
<pre><code>-agentlib:jdwp=&lt;options&gt;
</code></pre>
<p>For more information about JVMTI, see <a href="https://docs.oracle.com/javase/8/docs/technotes/guides/management/index.html">https://docs.oracle.com/javase/8/docs/technotes/guides/management/index.html</a>.</p>
<p>For a guide about writing a JVMTI agent, see <a href="https://www.oracle.com/technetwork/articles/javase/jvmti-136367.html">http://www.oracle.com/technetwork/articles/javase/jvmti-136367.html</a>.</p>
<h2 id="openj9-extensions">OpenJ9 extensions</h2>
<p>OpenJ9 extensions to the JVMTI allow a JVMTI agent to query or automatically trigger operations in the VM, including the following tasks:</p>
<table>
<thead>
<tr>
<th>Task</th>
<th>OpenJ9 extensions</th>
</tr>
</thead>
<tbody>
<tr>
<td>Get the OS thread ID</td>
<td><a href="#getosthreadid"><code>GetOSThreadID</code></a></td>
</tr>
<tr>
<td>Query, set, and reset the VM dump options</td>
<td><a href="#queryvmdump"><code>QueryVmDump</code></a>, <a href="#setvmdump"><code>SetVmDump</code></a>, <a href="#resetvmdump"><code>ResetVmDump</code></a></td>
</tr>
<tr>
<td>Trigger a VM dump, and monitor JVMTI event functions when VM dumps start and end</td>
<td><a href="#triggervmdump"><code>TriggerVmDump</code></a>, <a href="#vmdumpstart"><code>VMDumpStart</code></a>, <a href="#vmdumpend"><code>VMDumpEnd</code></a></td>
</tr>
<tr>
<td>Set VM trace options</td>
<td><a href="#setvmtrace"><code>SetVmTrace</code></a></td>
</tr>
<tr>
<td>Subscribe to and unsubscribe from VM tracepoints</td>
<td><a href="#registertracepointsubscriber"><code>RegisterTracePointSubscriber</code></a>, <a href="#deregistertracepointsubscriber"><code>DeregisterTracePointSubscriber</code></a></td>
</tr>
<tr>
<td>Query runtime environment native memory categories</td>
<td><a href="#getmemorycategories"><code>GetMemoryCategories</code></a></td>
</tr>
<tr>
<td>Query and set VM log options</td>
<td><a href="#queryvmlogoptions"><code>QueryVmLogOptions</code></a>, <a href="#setvmlogoptions"><code>SetVmLogOptions</code></a></td>
</tr>
<tr>
<td>Search for and remove a shared classes cache</td>
<td><a href="#iteratesharedcaches"><code>IterateSharedCaches</code></a>, <a href="#destroysharedcache"><code>DestroySharedCache</code></a></td>
</tr>
<tr>
<td>Subscribe to and unsubscribe from verbose garbage collection (GC) data logging</td>
<td><a href="#registerverbosegcsubscriber"><code>RegisterVerboseGCSubscriber</code></a>, <a href="#deregisterverbosegcsubscriber"><code>DeregisterVerboseGCSubscriber</code></a></td>
</tr>
</tbody>
</table>
<p>The definitions that you need when you write a JVMTI agent are provided in the header files <code>jvmti.h</code> and <code>ibmjvmti.h</code>, in the <code>include</code> directory.</p>
<h2 id="sample-jvmti-agent">Sample JVMTI agent</h2>
<p>The following sample shows you how to write a simple JVMTI agent that uses OpenJ9 extensions to the JVMTI.</p>
<details>
<summary>Sample JVMTI agent written in C/C++, which uses the OpenJ9 extensions</summary>
<pre><code>/*
* tiSample.c
*
* Sample JVMTI agent to demonstrate the OpenJ9 JVMTI dump extensions
*/
#include &quot;jvmti.h&quot;
#include &quot;ibmjvmti.h&quot;
/* Forward declarations for JVMTI callback functions */
void JNICALL VMInitCallback(jvmtiEnv *jvmti_env, JNIEnv* jni_env, jthread thread);
void JNICALL DumpStartCallback(jvmtiEnv *jvmti_env, char* label, char* event, char* detail, ...);
/*
* Agent_Onload()
*
* JVMTI agent initialisation function, invoked as agent is loaded by the VM
*/
JNIEXPORT jint JNICALL Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) {
jvmtiEnv *jvmti = NULL;
jvmtiError rc;
jint extensionEventCount = 0;
jvmtiExtensionEventInfo *extensionEvents = NULL;
jint extensionFunctionCount = 0;
jvmtiExtensionFunctionInfo *extensionFunctions = NULL;
int i = 0, j = 0;
printf(&quot;tiSample: Loading JVMTI sample agent\n&quot;);
/* Get access to JVMTI */
(*jvm)-&gt;GetEnv(jvm, (void **)&amp;jvmti, JVMTI_VERSION_1_0);
/* Look up all the JVMTI extension events and functions */
(*jvmti)-&gt;GetExtensionEvents(jvmti, &amp;extensionEventCount, &amp;extensionEvents);
(*jvmti)-&gt;GetExtensionFunctions(jvmti, &amp;extensionFunctionCount, &amp;extensionFunctions);
printf(&quot;tiSample: Found %i JVMTI extension events, %i extension functions\n&quot;, extensionEventCount, extensionFunctionCount);
/* Find the JVMTI extension event we want */
while (i++ &lt; extensionEventCount) {
if (strcmp(extensionEvents-&gt;id, COM_IBM_VM_DUMP_START) == 0) {
/* Found the dump start extension event, now set up a callback for it */
rc = (*jvmti)-&gt;SetExtensionEventCallback(jvmti, extensionEvents-&gt;extension_event_index, &amp;DumpStartCallback);
printf(&quot;tiSample: Setting JVMTI event callback %s, rc=%i\n&quot;, COM_IBM_VM_DUMP_START, rc);
break;
}
extensionEvents++; /* move on to the next extension event */
}
/* Find the JVMTI extension function we want */
while (j++ &lt; extensionFunctionCount) {
jvmtiExtensionFunction function = extensionFunctions-&gt;func;
if (strcmp(extensionFunctions-&gt;id, COM_IBM_SET_VM_DUMP) == 0) {
/* Found the set dump extension function, now set a dump option to generate javadumps on
thread starts */
rc = function(jvmti, &quot;java:events=thrstart&quot;);
printf(&quot;tiSample: Calling JVMTI extension %s, rc=%i\n&quot;, COM_IBM_SET_VM_DUMP, rc);
break;
}
extensionFunctions++; /* move on to the next extension function */
}
return JNI_OK;
}
/*
* DumpStartCallback()
* JVMTI callback for dump start event (IBM JVMTI extension) */
void JNICALL
DumpStartCallback(jvmtiEnv *jvmti_env, char* label, char* event, char* detail, ...) {
printf(&quot;tiSample: Received JVMTI event callback, for event %s\n&quot;, event);
}
</code></pre>
</details>
<p>The sample JVMTI agent consists of two functions, <code>Agent_OnLoad()</code> and <code>DumpStartCallback()</code>:</p>
<h3 id="agent_onload"><code>Agent_OnLoad()</code></h3>
<p>This function is called by the VM when the agent is loaded at VM startup, which allows the JVMTI agent to modify VM behavior before initialization is complete. The sample agent obtains access to the JVMTI interface by using the JNI Invocation API function <code>GetEnv()</code>. The agent calls the APIs <code>GetExtensionEvents()</code> and <code>GetExtensionFunctions()</code> to find the JVMTI extensions that are supported by the VM. These APIs provide access to the list of extensions available in the <code>jvmtiExtensionEventInfo</code> and <code>jvmtiExtensionFunctionInfo</code> structures. The sample uses an extension event and an extension function in the following way:</p>
<p><strong>Extension event:</strong> The sample JVMTI agent searches for the extension event <code>VmDumpStart</code> in the list of <code>jvmtiExtensionEventInfo</code> structures, by using the identifier <code>COM_IBM_VM_DUMP_START</code> provided in <code>ibmjvmti.h</code>. When the event is found, the JVMTI agent calls the JVMTI interface <code>SetExtensionEventCallback()</code> to enable the event, providing a function <code>DumpStartCallback()</code> that is called when the event is triggered.</p>
<p><strong>Extension function:</strong> Next, the sample JVMTI agent searches for the extension function <code>SetVMDump</code> in the list of <code>jvmtiExtensionFunctionInfo</code> structures, by using the identifier <code>COM_IBM_SET_VM_DUMP</code> provided in <code>ibmjvmti.h</code>. The JVMTI agent calls the function by using the <code>jvmtiExtensionFunction</code> pointer to set a VM dump option <code>java:events=thrstart</code>. This option requests the VM to trigger a Java dump every time a VM thread is started.</p>
<h3 id="dumpstartcallback"><code>DumpStartCallback()</code></h3>
<p>This callback function issues a message when the associated extension event is called. In the sample code, <code>DumpStartCallback()</code> is used when the <code>VmDumpStart</code> event is triggered.</p>
<h3 id="using-the-sample-jvmti-agent">Using the sample JVMTI agent</h3>
<ul>
<li>
<p>Build the sample JVMTI agent:</p>
<p>Windows:</p>
<pre><code>cl /I&lt;jre_path&gt;\include /MD /FetiSample.dll tiSample.c /link /DLL
</code></pre>
<p>Linux, AIX®, and z/OS®:</p>
<pre><code>gcc -I&lt;jre_path&gt;/include -o libtiSample.so -shared tiSample.c
</code></pre>
<p>where <code>&lt;jre_path&gt;</code> is the path to your Java runtime environment installation.</p>
</li>
<li>
<p>To run the sample JVMTI agent, use the command:</p>
<pre><code>java -agentlib:tiSample -version
</code></pre>
<p>When the sample JVMTI agent loads, messages are generated. When the JVMTI agent initiates a Java dump, the message <code>JVMDUMP010</code> is issued.</p>
</li>
</ul>
<h2 id="api-reference">API reference</h2>
<p>The following sections provide reference information for the OpenJ9 extensions to the JVMTI.</p>
<!-- ==================================================================================================== -->
<h3 id="getosthreadid"><code>GetOSThreadID</code></h3>
<p>You can get the OS thread ID by using the <code>GetOSThreadID()</code> API:</p>
<pre><code>jvmtiError GetOSThreadID(jvmtiEnv* jvmti_env, jthread thread, jlong * threadid_ptr);
</code></pre>
<p><strong>Parameters</strong></p>
<ul>
<li><code>jvmti_env</code>: A pointer to the JVMTI environment.</li>
<li><code>thread</code>: The thread for which the ID is required.</li>
<li><code>threadid_ptr</code>: A pointer to a variable, used to return the thread ID that corresponds to the thread specified by the <code>thread</code> parameter.</li>
</ul>
<p><strong>Returns</strong></p>
<p><code>JVMTI_ERROR_NONE</code>: Success<br />
<code>JVMTI_ERROR_NULL_POINTER</code>: The <code>threadid_ptr</code> parameter is null.<br />
<code>JVMTI_ERROR_INVALID_ENVIRONMENT</code>: The <code>jvmti_env</code> parameter is invalid.<br />
<code>JVMTI_ERROR_INVALID_THREAD</code>: The thread is not valid.<br />
<code>JVMTI_ERROR_THREAD_NOT_ALIVE</code>: The VM state of the thread is not started or has died.<br />
<code>JVMTI_ERROR_UNATTACHED_THREAD</code>: The current thread is not attached to the VM.
<code>JVMTI_ERROR_WRONG_PHASE</code>: The extension has been called outside the JVMTI start or live phase.</p>
<p><strong>Identifiers</strong></p>
<p>JVMTI Extension Function identifier: <code>com.ibm.GetOSThreadID</code><br />
Macro declaration in the <code>ibmjvmti.h</code> file: <code>COM_IBM_GET_OS_THREAD_ID</code></p>
<hr />
<!-- ==================================================================================================== -->
<h3 id="queryvmdump"><code>QueryVmDump</code></h3>
<p>You can query the VM dump options that are set for a VM by using the <code>QueryVmDump()</code> API:</p>
<pre><code>jvmtiError QueryVmDump(jvmtiEnv* jvmti_env, jint buffer_size, void* options_buffer, jint* data_size_ptr)
</code></pre>
<p>This extension returns a set of dump option specifications as ASCII strings. The syntax of the option string is the same as the <code>-Xdump</code> command-line option, with the initial <code>-Xdump:</code> omitted. See <a href="../xdump/">-Xdump</a>. The option strings are separated by newline characters. If the memory buffer is too small to contain the current VM dump option strings, you can expect the following results:</p>
<ul>
<li>The error message <code>JVMTI_ERROR_ILLEGAL_ARGUMENT</code> is returned.</li>
<li>The variable for <code>data_size_ptr</code> is set to the required buffer size.</li>
</ul>
<p><strong>Parameters</strong></p>
<ul>
<li><code>jvmti_env</code>: A pointer to the JVMTI environment.</li>
<li><code>buffer_size</code>: The size of the supplied memory buffer in bytes.</li>
<li><code>options_buffer</code>: A pointer to the supplied memory buffer.</li>
<li><code>data_size_ptr</code>: A pointer to a variable, used to return the total size of the option strings.</li>
</ul>
<p><strong>Returns</strong></p>
<p><code>JVMTI_ERROR_NONE</code>: Success<br />
<code>JVMTI_ERROR_NULL_POINTER</code>: The <code>options_buffer</code> or <code>data_size_ptr</code> parameters are null.<br />
<code>JVMTI_ERROR_OUT_OF_MEMORY</code>: There is insufficient system memory to process the request.<br />
<code>JVMTI_ERROR_INVALID_ENVIRONMENT</code>: The <code>jvmti_env</code> parameter is invalid.<br />
<code>JVMTI_ERROR_WRONG_PHASE</code>: The extension has been called outside the JVMTI live phase.<br />
<code>JVMTI_ERROR_NOT_AVAILABLE</code>: The dump configuration is locked because a dump is in progress.<br />
<code>JVMTI_ERROR_ILLEGAL_ARGUMENT</code>: The supplied memory buffer in <code>options_buffer</code> is too small.</p>
<p><strong>Identifiers</strong></p>
<p>JVMTI Extension Function identifier: <code>com.ibm.QueryVmDump</code><br />
Macro declaration in the <code>ibmjvmti.h</code> file: <code>COM_IBM_QUERY_VM_DUMP</code></p>
<hr />
<!-- ==================================================================================================== -->
<h3 id="setvmdump"><code>SetVmDump</code></h3>
<p>You can set VM dump options by using the <code>SetVmDump()</code> API:</p>
<pre><code>jvmtiError SetVmDump(jvmtiEnv* jvmti_env, char* option)
</code></pre>
<p>The dump option is passed in as an ASCII character string. Use the same syntax as the <code>-Xdump</code> command-line option, with the initial <code>-Xdump:</code> omitted. See <a href="../xdump/">-Xdump</a>.</p>
<p>When dumps are in progress, the dump configuration is locked, and calls to <code>SetVmDump()</code> fail with a return value of <code>JVMTI_ERROR_NOT_AVAILABLE</code>.</p>
<p><strong>Parameters</strong></p>
<ul>
<li><code>jvmti_env</code>: A pointer to the JVMTI environment.</li>
<li><code>option</code>: The VM dump option string.<br />
<i class="fa fa-pencil-square-o" aria-hidden="true"></i> <strong>Note:</strong> On z/OS, you might need to convert the option string from EBCDIC to ASCII before using this JVMTI extension function.</li>
</ul>
<p><strong>Returns</strong></p>
<p><code>JVMTI_ERROR_NONE</code>: Success.<br />
<code>JVMTI_ERROR_NULL_POINTER</code>: The parameter option is null.<br />
<code>JVMTI_ERROR_OUT_OF_MEMORY</code>: There is insufficient system memory to process the request.<br />
<code>JVMTI_ERROR_INVALID_ENVIRONMENT</code>: The <code>jvmti_env</code> parameter is invalid.<br />
<code>JVMTI_ERROR_WRONG_PHASE</code>: The extension has been called outside the JVMTI live phase.<br />
<code>JVMTI_ERROR_NOT_AVAILABLE</code>: The dump configuration is locked because a dump is in progress.<br />
<code>JVMTI_ERROR_ILLEGAL_ARGUMENT</code>: The parameter option contains an invalid <code>-Xdump</code> string.</p>
<p><strong>Identifiers</strong></p>
<p>JVMTI Extension Function identifier: <code>com.ibm.SetVmDump</code><br />
Macro declaration in the <code>ibmjvmti.h</code> file: <code>COM_IBM_SET_VM_DUMP</code></p>
<hr />
<!-- ==================================================================================================== -->
<h3 id="triggervmdump"><code>TriggerVmDump</code></h3>
<p>You can trigger a VM dump and specify the type of dump you want by using the <code>TriggerVmDump()</code> API:</p>
<pre><code>jvmtiError TriggerVmDump(jvmtiEnv* jvmti_env, char* option)
</code></pre>
<p>Choose the type of dump required by specifying an ASCII string that contains one of the supported dump agent types. See <a href="../xdump/">-Xdump</a>. JVMTI events are provided at the start and end of the dump.</p>
<p><strong>Parameters</strong></p>
<ul>
<li><code>jvmti_env</code>: A pointer to the JVMTI environment.</li>
<li>
<p><code>option</code>: A pointer to the dump type string, which can be one of the following types: </p>
<p><code>stack</code><br />
<code>java</code><br />
<code>system</code><br />
<code>console</code><br />
<code>tool</code><br />
<code>heap</code><br />
<code>snap</code><br />
<code>ceedump</code> (z/OS only) </p>
<p><i class="fa fa-pencil-square-o" aria-hidden="true"></i> <strong>Note:</strong> On z/OS, you might need to convert the option string from EBCDIC to ASCII before using this JVMTI extension function.</p>
</li>
</ul>
<p><strong>Returns</strong></p>
<p><code>JVMTI_ERROR_NONE</code>: Success.<br />
<code>JVMTI_ERROR_NULL_POINTER</code>: The option parameter is null.<br />
<code>JVMTI_ERROR_OUT_OF_MEMORY</code>: There is insufficient system memory to process the request.<br />
<code>JVMTI_ERROR_INVALID_ENVIRONMENT</code>: The <code>jvmti_env</code> parameter is invalid.<br />
<code>JVMTI_ERROR_WRONG_PHASE</code>: The extension has been called outside the JVMTI live phase.<br />
<code>JVMTI_ERROR_NOT_AVAILABLE</code>: The dump configuration is locked because a dump is in progress.</p>
<p><strong>Identifiers</strong></p>
<p>JVMTI Extension Function identifier: <code>com.ibm.TriggerVmDump</code><br />
Macro declaration in the <code>ibmjvmti.h</code> file: <code>COM_IBM_TRIGGER_VM_DUMP</code></p>
<hr />
<!-- ==================================================================================================== -->
<h3 id="resetvmdump"><code>ResetVmDump</code></h3>
<p>You can reset VM dump options to the values at VM initialization by using the <code>ResetVmDump()</code> API:</p>
<pre><code>jvmtiError ResetVmDump(jvmtiEnv* jvmti_env)
</code></pre>
<p><strong>Parameters</strong></p>
<ul>
<li><code>jvmti_env</code>: The JVMTI environment pointer.</li>
</ul>
<p><strong>Returns</strong></p>
<p><code>JVMTI_ERROR_NONE</code>: Success.<br />
<code>JVMTI_ERROR_OUT_OF_MEMORY</code>: There is insufficient system memory to process the request.<br />
<code>JVMTI_ERROR_INVALID_ENVIRONMENT</code>: The <code>jvmti_env</code> parameter is invalid.<br />
<code>JVMTI_ERROR_WRONG_PHASE</code>: The extension has been called outside the JVMTI live phase.<br />
<code>JVMTI_ERROR_NOT_AVAILABLE</code>: The dump configuration is locked because a dump is in progress.</p>
<p><strong>Identifiers</strong></p>
<p>JVMTI Extension Function identifier: <code>com.ibm.ResetVmDump</code><br />
Macro declaration in the <code>ibmjvmti.h</code> file: <code>COM_IBM_RESET_VM_DUMP</code></p>
<hr />
<!-- ==================================================================================================== -->
<h3 id="vmdumpstart"><code>VMDumpStart</code></h3>
<p>The following JVMTI event function is called when a VM dump starts:</p>
<pre><code>void JNICALL VMDumpStart(jvmtiEnv *jvmti_env, JNIEnv* jni_env, char* label, char* event, char* detail)
</code></pre>
<p>The event function provides the dump file name, the name of the JVMTI event, and the detail string from the dump event. The detail string provides additional information about the event that triggered the dump. This information is the same as the information detailed in the <code>JVMDUMP039I</code> message. For example:</p>
<pre><code>JVMDUMP039I Processing dump event "systhrow", detail "java/lang/OutOfMemoryError" at 2014/10/17 13:31:03 - please wait."
</code></pre>
<p><strong>Parameters</strong></p>
<ul>
<li><code>jvmti_env</code>: JVMTI environment pointer.</li>
<li><code>jni_env</code>: JNI environment pointer for the thread on which the event occurred.</li>
<li><code>label</code>: The dump file name, including directory path.</li>
<li><code>event</code>: The extension event name, such as <code>com.ibm.VmDumpStart</code>.</li>
<li><code>detail</code>: The dump event detail string. The string can be empty.</li>
</ul>
<p><strong>Returns</strong></p>
<p>None</p>
<hr />
<!-- ==================================================================================================== -->
<h3 id="vmdumpend"><code>VMDumpEnd</code></h3>
<p>The following JVMTI event function is called when a VM dump ends:</p>
<pre><code>void JNICALL VMDumpEnd(jvmtiEnv *jvmti_env, JNIEnv* jni_env, char* label, char* event, char* detail)
</code></pre>
<p>The event function provides the dump file name, the name of the JVMTI event, and the detail string from the dump event. The detail string provides additional information about the event that triggered the dump. This information is the same as the information detailed in the <code>JVMDUMP039I</code> message. For example:</p>
<pre><code>JVMDUMP039I Processing dump event "systhrow", detail "java/lang/OutOfMemoryError" at 2014/10/17 13:31:03 - please wait.
</code></pre>
<p><strong>Parameters</strong></p>
<ul>
<li><code>jvmti_env</code>: JVMTI environment pointer. </li>
<li><code>jni_env</code>: JNI environment pointer for the thread on which the event occurred. </li>
<li><code>label</code>: The dump file name, including directory path. </li>
<li><code>event</code>: The extension event name <code>com.ibm.VmDumpEnd</code>. </li>
<li><code>detail</code>: The dump event detail string. The string can be empty. </li>
</ul>
<p><strong>Returns</strong></p>
<p>None</p>
<!-- ==================================================================================================== -->
<hr />
<h3 id="setvmtrace"><code>SetVmTrace</code></h3>
<p>You can set VM trace options by using the <code>SetVmTrace()</code> API:</p>
<pre><code>jvmtiError SetVmTrace(jvmtiEnv* jvmti_env, char* option)
</code></pre>
<p>The trace option is passed in as an ASCII character string. Use the same syntax as the <code>-Xtrace</code> command-line option, with the initial <code>-Xtrace:</code> omitted. See <a href="../xtrace/">-Xtrace</a>.</p>
<p><strong>Parameters</strong></p>
<ul>
<li><code>jvmti_env</code>: JVMTI environment pointer.</li>
<li><code>option</code>: Enter the VM trace option string.<br />
<i class="fa fa-pencil-square-o" aria-hidden="true"></i> <strong>Note:</strong> On z/OS, you might need to convert the option string from EBCDIC to ASCII before using this JVMTI extension function.</li>
</ul>
<p><strong>Returns</strong></p>
<p><code>JVMTI_ERROR_NONE</code>: Success.<br />
<code>JVMTI_ERROR_NULL_POINTER</code>: The option parameter is null.<br />
<code>JVMTI_ERROR_OUT_OF_MEMORY</code>: There is insufficient system memory to process the request.<br />
<code>JVMTI_ERROR_INVALID_ENVIRONMENT</code>: The <code>jvmti_env</code> parameter is invalid.<br />
<code>JVMTI_ERROR_WRONG_PHASE</code>: The extension has been called outside the JVMTI live phase.<br />
<code>JVMTI_ERROR_ILLEGAL_ARGUMENT</code>: The option parameter contains an invalid <code>-Xtrace</code> string. </p>
<p><strong>Identifiers</strong></p>
<p>JVMTI Extension Function identifier: <code>com.ibm.SetVmTrace</code><br />
Macro declaration in the <code>ibmjvmti.h</code> file: <code>COM_IBM_SET_VM_TRACE</code></p>
<hr />
<!-- ==================================================================================================== -->
<h3 id="registertracepointsubscriber"><code>RegisterTracePointSubscriber</code></h3>
<p>You can subscribe to VM tracepoints by using the <code>RegisterTracePointSubscriber()</code> API:</p>
<pre><code>jvmtiError RegisterTracePointSubscriber(jvmtiEnv* jvmti_env, char *description, jvmtiTraceSubscriber subscriber, jvmtiTraceAlarm alarm, void *userData, void **subscriptionID)
</code></pre>
<p><strong>Parameters</strong></p>
<ul>
<li><code>jvmti_env</code>: A pointer to the JVMTI environment.</li>
<li><code>description</code>: An ASCII character string that describes the subscriber.</li>
<li><code>subscriber</code>: A function of type <a href="#jvmtitracesubscriber-function"><code>jvmtiTraceSubscriber</code></a>.</li>
<li><code>alarm</code>: A function pointer of type <a href="#jvmtitracealarm-function"><code>jvmtiTraceAlarm</code></a>.</li>
<li><code>user_data</code>: A pointer to user data. This pointer is passed to the subscriber and alarm functions each time these functions are called. This pointer can be a null value.</li>
<li><code>subscription_id</code>: A pointer to a subscription identifier. This pointer is returned by the <code>RegisterTracePointSubscriber</code> call if successful. The value must be supplied to a future call to the <code>DeregisterTracePointSubscriber</code> API, which is used to unsubscribe from the VM tracepoint.</li>
</ul>
<p><strong>Returns</strong></p>
<p><code>JVMTI_ERROR_NONE</code>: Success.<br />
<code>JVMTI_ERROR_NULL_POINTER</code>: One of the supplied parameters is null.<br />
<code>JVMTI_ERROR_OUT_OF_MEMORY</code>: There is insufficient system memory to process the request.<br />
<code>JVMTI_ERROR_INVALID_ENVIRONMENT</code>: The <code>jvmti_env</code> parameter is not valid.<br />
<code>JVMTI_ERROR_WRONG_PHASE</code>: The extension has been called outside the JVMTI live phase.<br />
<code>JVMTI_ERROR_NOT_AVAILABLE</code>: VM trace is not available.<br />
<code>JVMTI_ERROR_INTERNAL</code>: An internal error occurred. </p>
<p><strong>Identifiers</strong></p>
<p>JVMTI Extension Function identifier: <code>com.ibm.RegisterTracePointSubscriber</code><br />
Macro declaration in the <code>ibmjvmti.h</code> file: <code>COM_IBM_REGISTER_TRACEPOINT_SUBSCRIBER</code></p>
<h4 id="jvmtitracesubscriber-function"><code>jvmtiTraceSubscriber</code> function</h4>
<dl>
<dd>
<p>The subscriber function type is defined as follows:</p>
<pre><code>typedef jvmtiError (*jvmtiTraceSubscriber)(jvmtiEnv *jvmti_env, void *record, jlong length, void *user_data);
</code></pre>
<p>The subscriber function must be of type <code>jvmtiTraceSubscriber</code>, which is declared in <code>ibmjvmti.h</code>.</p>
<p>This function is called with each tracepoint record that is selected through the <code>-Xtrace:external</code> option.</p>
<p>The tracepoint record that is supplied to the subscriber function is valid only for the duration of the function. If the subscriber wants to save the data, the data must be copied elsewhere.</p>
<p>If the subscriber function returns an error, the alarm function is called, the subscription is disconnected, and no further tracepoints are sent to the subscriber.</p>
<p><strong>Subscriber function parameters</strong></p>
<ul>
<li><code>jvmti_env</code>: A pointer to the JVMTI environment.</li>
<li><code>record</code>: A UTF-8 string that contains a tracepoint record.</li>
<li><code>length</code>: The number of UTF-8 characters in the tracepoint record.</li>
<li><code>user_data</code>: User data that is supplied when the subscriber is registered.</li>
</ul>
</dd>
</dl>
<h4 id="jvmtitracealarm-function"><code>jvmtiTraceAlarm</code> function</h4>
<dl>
<dd>
<p>The alarm function type is defined as follows:</p>
<pre><code>typedef jvmtiError (*jvmtiTraceAlarm)(jvmtiEnv *jvmti_env, void *subscription_id, void *user_data);
</code></pre>
<p>The alarm function must be of type <code>jvmtiTraceAlarm</code>, which is declared in <code>ibmjvmti.h</code>. This function is called if the subscriber function returns an error.</p>
<p><strong>Alarm function parameters</strong></p>
<ul>
<li><code>jvmti_env</code>: A pointer to the JVMTI environment.</li>
<li><code>subscription_id</code>: The subscription identifier.</li>
<li><code>user_data</code>: User data that is supplied when the subscriber is registered.</li>
</ul>
</dd>
</dl>
<hr />
<!-- ==================================================================================================== -->
<h3 id="deregistertracepointsubscriber"><code>DeregisterTracePointSubscriber</code></h3>
<p>You can unsubscribe from VM tracepoints by using the <code>DeregisterTracePointSubscriber()</code> API:</p>
<pre><code>jvmtiError DeregisterTracePointSubscriber(jvmtiEnv* jvmti_env, void *userData, void *subscription_id)
</code></pre>
<p>After the <code>DeregisterTracePointSubscriber()</code> API is called, no further calls are made to the subscriber function.</p>
<p><strong>Parameters</strong></p>
<ul>
<li><code>jvmti_env</code>: A pointer to the JVMTI environment.</li>
<li><code>subscription_id</code>: The subscription identifier that is returned by the call to the <a href="#registertracepointsubscriber">RegisterTracePointSubscriber</a> API.</li>
</ul>
<p><strong>Returns</strong></p>
<p><code>JVMTI_ERROR_NONE</code>: Success.<br />
<code>JVMTI_ERROR_NULL_POINTER</code>: The <code>subscription_id</code> parameter is null.<br />
<code>JVMTI_ERROR_OUT_OF_MEMORY</code>: There is insufficient system memory to process the request.<br />
<code>JVMTI_ERROR_INVALID_ENVIRONMENT</code>: The <code>jvmti_env</code> parameter is not valid.<br />
<code>JVMTI_ERROR_WRONG_PHASE</code>: The extension has been called outside the JVMTI live phase. </p>
<p><strong>Identifiers</strong></p>
<p>JVMTI Extension Function identifier: <code>com.ibm.DeregisterTracePointSubscriber</code><br />
Macro declaration in the <code>ibmjvmti.h</code> file: <code>COM_IBM_DEREGISTER_TRACEPOINT_SUBSCRIBER</code></p>
<hr />
<!-- ==================================================================================================== -->
<h3 id="getmemorycategories"><code>GetMemoryCategories</code></h3>
<p>You can query runtime environment native memory categories by using the <code>GetMemoryCategories()</code> API:</p>
<pre><code>jvmtiError GetMemoryCategories(jvmtiEnv* env, jint version, jint max_categories, jvmtiMemoryCategory * categories_buffer, jint * written_count_ptr, jint * total_categories_ptr);
</code></pre>
<p>You can query the total native memory consumption of the runtime environment for each memory category by using this API. Native memory is memory requested from the operating system using library functions such as <code>malloc()</code> and <code>mmap()</code>. Runtime environment native memory use is grouped under high-level memory categories, as described in the <code>NATIVEMEMINFO</code> section of the <em>Java dump</em> topic. The data returned by the <code>GetMemoryCategories()</code> API is consistent with this format. See <a href="../dump_javadump/#nativememinfo">Java dump: NATIVEMEMINFO</a>.</p>
<p>The extension writes native memory information to a memory buffer specified by the user. Each memory category is recorded as a <code>jvmtiMemoryCategory</code> structure, whose format is defined in <code>ibmjvmti.h</code>.</p>
<p>You can use the <code>GetMemoryCategories()</code> API to work out the buffer size you must allocate to hold all memory categories defined inside the VM. To calculate the size, call the API with a null <code>categories_buffer</code> argument and a non-null <code>total_categories_ptr</code> argument.</p>
<p><strong>Parameters</strong></p>
<ul>
<li><code>env</code>: A pointer to the JVMTI environment.</li>
<li><code>version</code>: The version of the <code>jvmtiMemoryCategory</code> structure that you are using. Use <code>COM_IBM_GET_MEMORY_CATEGORIES_VERSION_1</code> for this argument, unless you must work with an obsolete version of the <code>jvmtiMemoryCategory</code> structure.</li>
<li><code>max_categories</code>: The number of <code>jvmtiMemoryCategory</code> structures that can fit in the <code>categories_buffer</code> memory buffer.</li>
<li><code>categories_buffer</code>: A pointer to the memory buffer for holding the result of the <code>GetMemoryCategories()</code> call. The number of <code>jvmtiMemoryCategory</code> slots available in the <code>categories_buffer</code> memory buffer must be accurately specified with <code>max_categories</code>, otherwise <code>GetMemoryCategories()</code> can overflow the memory buffer. The value can be null.</li>
<li><code>written_count_ptr</code>: A pointer to <code>jint</code> to store the number of <code>jvmtiMemoryCategory</code> structures to be written to the <code>categories_buffer</code> memory buffer. The value can be null.</li>
<li><code>total_categories_ptr</code>: A pointer to <code>jint</code> to store the total number of memory categories declared in the VM. The value can be null.</li>
</ul>
<p><strong>Returns</strong></p>
<p><code>JVMTI_ERROR_NONE</code>: Success.<br />
<code>JVMTI_ERROR_UNSUPPORTED_VERSION</code>: Unrecognized value passed for version.<br />
<code>JVMTI_ERROR_ILLEGAL_ARGUMENT</code>: Illegal argument; <code>categories_buffer</code>, <code>count_ptr</code>, and <code>total_categories_ptr</code> all have null values.<br />
<code>JVMTI_ERROR_INVALID_ENVIRONMENT</code>: The <code>env</code> parameter is invalid.<br />
<code>JVMTI_ERROR_OUT_OF_MEMORY</code>: Memory category data is truncated because <code>max_categories</code> is not large enough. </p>
<p><strong>Identifiers</strong></p>
<p>JVMTI Extension Function identifier: <code>com.ibm.GetMemoryCategories</code><br />
Macro declaration in the <code>ibmjvmti.h</code> file: <code>COM_IBM_GET_MEMORY_CATEGORIES</code></p>
<hr />
<!-- ==================================================================================================== -->
<h3 id="queryvmlogoptions"><code>QueryVmLogOptions</code></h3>
<p>You can query VM log options by using the <code>QueryVmLogOptions()</code> API:</p>
<pre><code>jvmtiError QueryVmLogOptions(jvmtiEnv* jvmti_env, jint buffer_size, void* options, jint* data_size_ptr)
</code></pre>
<p>This extension returns the current log options as an ASCII string. The syntax of the string is the same as the <code>-Xsyslog</code> command-line option, with the initial <code>-Xsyslog:</code> omitted. For example, the string "error,warn" indicates that the VM is set to log error and warning messages only. For more information, see <a href="../xsyslog/"><code>-Xsyslog</code></a>.</p>
<p><strong>Parameters</strong></p>
<ul>
<li><code>jvmti_env</code>: A pointer to the JVMTI environment. </li>
<li><code>buffer_size</code>: The size of the supplied memory buffer in bytes. If the memory buffer is too small to contain the current VM log option string, the <code>JVMTI_ERROR_ILLEGAL_ARGUMENT</code> error message is returned. </li>
<li><code>options_buffer</code>: A pointer to the supplied memory buffer. </li>
<li><code>data_size_ptr</code>: A pointer to a variable, used to return the total size of the option string.</li>
</ul>
<p><strong>Returns</strong></p>
<p><code>JVMTI_ERROR_NONE</code>: Success<br />
<code>JVMTI_ERROR_NULL_POINTER</code>: The <code>options</code> or <code>data_size_ptr</code> parameters are null.<br />
<code>JVMTI_ERROR_INVALID_ENVIRONMENT</code>: The <code>jvmti_env</code> parameter is invalid.<br />
<code>JVMTI_ERROR_WRONG_PHASE</code>: The extension has been called outside the JVMTI live phase.<br />
<code>JVMTI_ERROR_ILLEGAL_ARGUMENT</code>: The supplied memory buffer is too small.</p>
<p><strong>Identifiers</strong></p>
<p>JVMTI Extension Function identifier: <code>com.ibm.QueryVmLogOptions</code><br />
Macro declaration in the <code>ibmjvmti.h</code> file: <code>COM_IBM_QUERY_VM_LOG_OPTIONS</code></p>
<hr />
<!-- ==================================================================================================== -->
<h3 id="setvmlogoptions"><code>SetVmLogOptions</code></h3>
<p>You can set VM log options by using the <code>SetVmLogOptions()</code> API:</p>
<pre><code>jvmtiError SetVmLogOptions(jvmtiEnv* jvmti_env, char* options_buffer)
</code></pre>
<p>The log option is passed in as an ASCII character string. Use the same syntax as the <code>-Xsyslog</code> command-line option, with the initial <code>-Xsyslog:</code> omitted. For example, to set the VM to log error and warning messages, pass in a string containing "error,warn". For more information, see <a href="../xsyslog/"><code>-Xsyslog</code></a>.</p>
<p><strong>Parameters</strong></p>
<ul>
<li><code>jvmti_env</code>: A pointer to the JVMTI environment.</li>
<li><code>options_buffer</code>: A pointer to memory containing the log option.</li>
</ul>
<p><strong>Returns</strong></p>
<p><code>JVMTI_ERROR_NONE</code>: Success.<br />
<code>JVMTI_ERROR_NULL_POINTER</code>: The parameter option is null.<br />
<code>JVMTI_ERROR_OUT_OF_MEMORY</code>: There is insufficient system memory to process the request.<br />
<code>JVMTI_ERROR_INVALID_ENVIRONMENT</code>: The <code>jvmti_env</code> parameter is invalid.<br />
<code>JVMTI_ERROR_WRONG_PHASE</code>: The extension has been called outside the JVMTI live phase.<br />
<code>JVMTI_ERROR_ILLEGAL_ARGUMENT</code>: The parameter option contains an invalid <code>-Xsyslog</code> string.</p>
<p><strong>Identifiers</strong></p>
<p>JVMTI Extension Function identifier: <code>com.ibm.SetVmLogOptions</code><br />
Macro declaration in the <code>ibmjvmti.h</code> file: <code>COM_IBM_SET_VM_LOG_OPTIONS</code></p>
<hr />
<!-- ==================================================================================================== -->
<h3 id="iteratesharedcaches"><code>IterateSharedCaches</code></h3>
<p>You can search for shared classes caches that exist in a specified cache directory by using the <code>IterateSharedCaches()</code> API:</p>
<pre><code>jvmtiError IterateSharedCaches(jvmtiEnv* env, jint version, const char *cacheDir, jint flags, jboolean useCommandLineValues, jvmtiIterateSharedCachesCallback callback, void *user_data);
</code></pre>
<p>Information about the caches is returned in a structure that is populated by a user-specified callback function. You can specify the search directory in two ways:</p>
<ul>
<li>Set the value of <code>useCommandLineValues</code> to <code>true</code> and specify the directory on the command line. If the directory is not specified on the command line, the default location for the platform is used.</li>
<li>Set the value of <code>useCommandLineValues</code> to <code>false</code> and use the <code>cacheDir</code> parameter. To accept the default location for the platform, specify <code>cacheDir</code> with a <code>null</code> value.</li>
</ul>
<p><strong>Parameters</strong></p>
<ul>
<li><code>env</code>: A pointer to the JVMTI environment.</li>
<li><code>version</code>: Version information for <code>IterateSharedCaches</code>, which describes the <code>jvmtiSharedCacheInfo</code> structure passed to the <code>jvmtiIterateSharedCachesCallback</code> function. The values allowed are:<ul>
<li><code>COM_IBM_ITERATE_SHARED_CACHES_VERSION_1</code></li>
<li><code>COM_IBM_ITERATE_SHARED_CACHES_VERSION_2</code></li>
<li><code>COM_IBM_ITERATE_SHARED_CACHES_VERSION_3</code></li>
<li><code>COM_IBM_ITERATE_SHARED_CACHES_VERSION_4</code></li>
<li><code>COM_IBM_ITERATE_SHARED_CACHES_VERSION_5</code></li>
</ul>
</li>
<li><code>cacheDir</code>: When the value of <code>useCommandLineValues</code> is <code>false</code>, specify the absolute path of the directory for the shared classes cache. If the value is <code>null</code>, the platform-dependent default is used.</li>
<li><code>flags</code>: Reserved for future use. The only value allowed is <code>COM_IBM_ITERATE_SHARED_CACHES_NO_FLAGS</code>.</li>
<li><code>useCommandLineValues</code>: Set this value to <code>true</code> when you want to specify the cache directory on the command line. Set this value to <code>false</code> when you want to use the <code>cacheDir</code> parameter.</li>
<li><code>callback</code>: A function pointer to a user provided callback routine <code>jvmtiIterateSharedCachesCallback</code>.</li>
<li><code>user_data</code>: User supplied data, passed as an argument to the callback function. <pre><code>jint (JNICALL *jvmtiIterateSharedCachesCallback)(jvmtiEnv *env,jvmtiSharedCacheInfo *cache_info, void *user_data);
</code></pre>
</li>
</ul>
<p><strong>Returns</strong></p>
<p><code>JVMTI_ERROR_NONE</code>: Success.<br />
<code>JVMTI_ERROR_OUT_OF_MEMORY</code>: There is insufficient system memory to process the request.<br />
<code>JVMTI_ERROR_INVALID_ENVIRONMENT</code>: The <code>env</code> parameter is not valid.<br />
<code>JVMTI_ERROR_WRONG_PHASE</code>: The extension has been called outside the JVMTI live phase.<br />
<code>JVMTI_ERROR_UNSUPPORTED_VERSION</code>: The <code>version</code> parameter is not valid.<br />
<code>JVMTI_ERROR_NULL_POINTER</code>: The <code>callback</code> parameter is null.<br />
<code>JVMTI_ERROR_NOT_AVAILABLE</code>: The shared classes feature is not enabled in the VM.<br />
<code>JVMTI_ERROR_ILLEGAL_ARGUMENT</code>: The <code>flags</code> parameter is not valid.<br />
<code>JVMTI_ERROR_INTERNAL</code>: This error is returned when the <code>jvmtiIterateSharedCachesCallback</code> returns <code>JNI_ERR</code>.</p>
<p><strong>Identifiers</strong></p>
<p>JVMTI Extension Function identifier: <code>com.ibm.IterateSharedCaches</code><br />
Macro declaration in the <code>ibmjvmti.h</code> file: <code>COM_IBM_ITERATE_SHARED_CACHES</code></p>
<h4 id="jvmtiiteratesharedcachescallback-function"><code>jvmtiIterateSharedCachesCallback</code> function</h4>
<dl>
<dd>
<p><strong>Callback function parameters</strong></p>
<ul>
<li><code>env</code>: A pointer to the JVMTI environment when calling <code>COM_IBM_ITERATE_SHARED_CACHES</code>.</li>
<li><code>cache_info</code>: A <code>jvmtiSharedCacheInfo</code> structure containing information about a shared cache.</li>
<li><code>user_data</code>: User-supplied data, passed as an argument to <code>IterateSharedCaches</code>.</li>
</ul>
<p><strong>Callback function returns</strong></p>
<p><code>JNI_OK</code>: Continue iterating.<br />
<code>JNI_ERR</code>: Stop iterating, which causes <code>IterateSharedCaches</code> to return <code>JVMTI_ERROR_INTERNAL</code></p>
</dd>
</dl>
<h4 id="jvmtisharedcacheinfo-structure"><code>jvmtiSharedCacheInfo</code> structure</h4>
<dl>
<dd>
<p>The structure of <code>jvmtiSharedCacheInfo</code></p>
<pre><code>typedef struct jvmtiSharedCacheInfo {
const char *name; // the name of the shared cache
jboolean isCompatible; // if the shared cache is compatible with this VM
jboolean isPersistent; // true if the shared cache is persistent, false if its non-persistent
jint os_shmid; // the OS shared memory ID associated with a non-persistent cache, -1 otherwise
jint os_semid; // the OS shared semaphore ID associated with a non-persistent cache, -1 otherwise
jint modLevel; // one of:
// COM_IBM_SHARED_CACHE_MODLEVEL_JAVA5
// COM_IBM_SHARED_CACHE_MODLEVEL_JAVA6
// COM_IBM_SHARED_CACHE_MODLEVEL_JAVA7
// COM_IBM_SHARED_CACHE_MODLEVEL_JAVA8
// COM_IBM_SHARED_CACHE_MODLEVEL_JAVA9
// from Java 10: the version number of the Java level on which the shared cache is created
jint addrMode; // the address mode of the VM creating the shared cache: includes additional
// information on whether it is a 64-bit compressedRefs cache when
// COM_IBM_ITERATE_SHARED_CACHES_VERSION_3 or later is specified.
jboolean isCorrupt; // if the cache is corrupted
jlong cacheSize; // the total usable shared classes cache size, or -1 when isCompatible is false
jlong freeBytes; // the number of free bytes in the shared classes cache, or -1 when isCompatible is false
jlong lastDetach; // the last detach time specified in milliseconds since 00:00:00 on 1 January 1970 UTC,
// or -1 when the last detach time is not available
jint cacheType; // the type of the cache
jlong softMaxBytes; // the soft limit for the available space in the cache
jint layer; // the shared cache layer number
} jvmtiSharedCacheInfo;
</code></pre>
<p><i class="fa fa-pencil-square-o" aria-hidden="true"></i> <strong>Notes:</strong></p>
<ul>
<li>
<p>The field <code>cacheType</code> is included when <code>COM_IBM_ITERATE_SHARED_CACHES_VERSION_2</code> or later is specified.</p>
</li>
<li>
<p><code>jvmtiSharedCacheInfo.addrMode</code> encodes both address mode and the compressed reference mode when <code>COM_IBM_ITERATE_SHARED_CACHES_VERSION_3</code> or later is specified. In this case, use the following set of macros to access the address mode and compressed reference mode:</p>
</li>
</ul>
<dl>
<dd>
<p>To get the address mode, use:</p>
<pre><code>COM_IBM_ITERATE_SHARED_CACHES_GET_ADDR_MODE(jvmtiSharedCacheInfo.addrMode)
</code></pre>
<p>This macro returns one of the following values:<br />
<code>COM_IBM_SHARED_CACHE_ADDRMODE_32</code><br />
<code>COM_IBM_SHARED_CACHE_ADDRMODE_64</code> </p>
</dd>
<dd>
<p>To get the compressed references mode, use:</p>
<pre><code>COM_IBM_ITERATE_SHARED_CACHES_GET_CMPRSSREF_MODE(jvmtiSharedCacheInfo.addrMode)
</code></pre>
<p>This macro returns one of the following values:<br />
<code>COM_IBM_ITERATE_SHARED_CACHES_UNKNOWN_COMPRESSED_POINTERS_MODE</code><br />
<code>COM_IBM_ITERATE_SHARED_CACHES_COMPRESSED_POINTERS_MODE</code><br />
<code>COM_IBM_ITERATE_SHARED_CACHES_NON_COMPRESSED_POINTERS_MODE</code> </p>
</dd>
</dl>
<ul>
<li>
<p>The field <code>softMaxBytes</code> is included when <code>COM_IBM_ITERATE_SHARED_CACHES_VERSION_4</code> or later is specified.</p>
</li>
<li>
<p>The field <code>layer</code> is included when <code>COM_IBM_ITERATE_SHARED_CACHES_VERSION_5</code> or later is specified. If the shared cache does not have a layer number, the value for <code>layer</code> is <code>-1</code>.</p>
</li>
</ul>
</dd>
</dl>
<hr />
<!-- ==================================================================================================== -->
<h3 id="destroysharedcache"><code>DestroySharedCache</code></h3>
<p>You can remove a shared classes cache by using the <code>DestroySharedCache()</code> API:</p>
<pre><code>jvmtiError DestroySharedCache(jvmtiEnv *env, const char *cacheDir, const char *name, jint persistence, jboolean useCommandLineValues, jint *internalErrorCode);
</code></pre>
<p>This extension removes a named shared classes cache of a given persistence type, in a given directory. You can specify the cache name, persistence type, and directory in one of these ways:</p>
<ul>
<li>
<p>Set <code>useCommandLineValues</code> to <code>true</code> and specify the values on the command line. If a value is not available, the default values for the platform are used.</p>
</li>
<li>
<p>Set <code>useCommandLineValues</code> to <code>false</code> and use the <code>cacheDir</code>, <code>persistence</code> and <code>cacheName</code> parameters to identify the cache to be removed. To accept the default value for <code>cacheDir</code> or <code>cacheName</code>, specify the parameter with a <code>null</code> value.</p>
</li>
</ul>
<p><strong>Parameters</strong></p>
<ul>
<li><code>env</code>: A pointer to the JVMTI environment.</li>
<li><code>cacheDir</code>: When the value of <code>useCommandLineValues</code> is <code>false</code>, specify the absolute path of the directory for the shared classes cache. If the value is <code>null</code>, the platform-dependent default is used.</li>
<li><code>cacheName</code>: When the value of <code>useCommandLineValues</code> is <code>false</code>, specify the name of the cache to be removed. If the value is <code>null</code>, the platform-dependent default is used.</li>
<li><code>persistence</code>: When the value of <code>useCommandLineValues</code> is false, specify the type of cache to remove. This parameter must have one of the following values:<br />
<code>PERSISTENCE_DEFAULT</code> (The default value for the platform).<br />
<code>PERSISTENT</code><br />
<code>NONPERSISTENT</code> </li>
<li><code>useCommandLineValues</code>: Set this value to <code>true</code> when you want to specify the shared classes cache name, persistence type, and directory on the command line. Set this value to <code>false</code> when you want to use the <code>cacheDir</code>, <code>persistence</code>, and <code>cacheName</code> parameters instead.</li>
<li><code>internalErrorCode</code>: If not <code>null</code>, this value is set to one of the following constants when <code>JVMTI_ERROR_INTERNAL</code> is returned: <ul>
<li><code>COM_IBM_DESTROYED_ALL_CACHE</code>: Set when <code>JVMTI_ERROR_NONE is</code> returned.</li>
<li><code>COM_IBM_DESTROYED_NONE</code>: Set when the function fails to remove any caches. </li>
<li><code>COM_IBM_DESTROY_FAILED_CURRENT_GEN_CACHE</code>: Set when the function fails to remove the existing current generation cache, irrespective of the state of older generation caches. </li>
<li><code>COM_IBM_DESTROY_FAILED_OLDER_GEN_CACHE</code>: Set when the function fails to remove any older generation caches. The current generation cache does not exist or is successfully removed.</li>
</ul>
</li>
</ul>
<p><strong>Returns</strong></p>
<p><code>JVMTI_ERROR_NONE</code>: Success. No cache exists or all existing caches of all generations are removed.<br />
<code>JVMTI_ERROR_OUT_OF_MEMORY</code>: There is insufficient system memory to process the request.<br />
<code>JVMTI_ERROR_INVALID_ENVIRONMENT</code>: The <code>env</code> parameter is not valid.<br />
<code>JVMTI_ERROR_WRONG_PHASE</code>: The extension has been called outside the JVMTI live phase.<br />
<code>JVMTI_ERROR_NOT_AVAILABLE</code>: The shared classes feature is not enabled in the VM.<br />
<code>JVMTI_ERROR_ILLEGAL_ARGUMENT</code>: The <code>persistence</code> parameter is not valid.
<code>JVMTI_ERROR_INTERNAL</code>: Failed to remove any existing cache with the given name. See the value of the <code>internalErrorCode</code> parameter for more information about the failure.</p>
<p><strong>Identifiers</strong></p>
<p>JVMTI Extension Function identifier: <code>com.ibm.DestroySharedCache</code><br />
Macro declaration in the <code>ibmjvmti.h</code> file: <code>COM_IBM_DESTROY_SHARED_CACHE</code></p>
<hr />
<!-- ==================================================================================================== -->
<h3 id="registerverbosegcsubscriber"><code>RegisterVerboseGCSubscriber</code></h3>
<p>You can subscribe to verbose garbage collection (GC) data logging by using the <code>RegisterVerboseGCSubscriber()</code> API:</p>
<pre><code>jvmtiError RegisterVerboseGCSubscriber(jvmtiEnv* jvmti_env, char *description, jvmtiVerboseGCSubscriber subscriber, jvmtiVerboseGCAlarm alarm, void *user_data, void **subscription_id)
</code></pre>
<p><strong>Parameters</strong></p>
<ul>
<li><code>jvmti_env</code>: A pointer to the JVMTI environment.</li>
<li><code>description</code>: An ASCII character string that describes the subscriber.</li>
<li><code>subscriber</code>: A function of type <a href="#jvmtiverbosegcsubscriber-function"><code>jvmtiVerboseGCSubscriber</code></a>.</li>
<li><code>alarm</code>: A function pointer of type <a href="#jvmtiverbosegcalarm-function"><code>jvmtiVerboseGCAlarm</code></a>.</li>
<li><code>user_data</code>: A pointer to user data. This pointer is passed to the subscriber and alarm functions each time these functions are called. This pointer can be a null value.</li>
<li><code>subscription_id</code>: A pointer to a subscription identifier. This pointer is returned by the <code>RegisterVerboseGCSubscriber</code> call if successful. The value must be supplied to a future call to <code>DeregisterVerboseGCSubscriber</code> API, which is used to unsubscribe from verbose GC data logging.</li>
</ul>
<p><strong>Returns</strong></p>
<p><code>JVMTI_ERROR_NONE</code>: Success.<br />
<code>JVMTI_ERROR_NULL_POINTER</code>: One of the supplied parameters is null.<br />
<code>JVMTI_ERROR_OUT_OF_MEMORY</code>: There is insufficient system memory to process the request.<br />
<code>JVMTI_ERROR_INVALID_ENVIRONMENT</code>: The <code>jvmti_env</code> parameter is not valid.<br />
<code>JVMTI_ERROR_WRONG_PHASE</code>: The extension has been called outside the JVMTI live phase.<br />
<code>JVMTI_ERROR_NOT_AVAILABLE</code>: GC verbose logging is not available.<br />
<code>JVMTI_ERROR_INTERNAL</code>: An internal error has occurred.</p>
<p><strong>Identifiers</strong></p>
<p>JVMTI Extension Function identifier: <code>com.ibm.RegisterVerboseGCSubscriber</code><br />
Macro declaration in the <code>ibmjvmti.h</code> file: <code>COM_IBM_REGISTER_VERBOSEGC_SUBSCRIBER</code></p>
<h4 id="jvmtiverbosegcsubscriber-function"><code>jvmtiVerboseGCSubscriber</code> function</h4>
<dl>
<dd>
<p>The subscriber function type is defined as follows:</p>
<pre><code>typedef jvmtiError (*jvmtiVerboseGCSubscriber)(jvmtiEnv *jvmti_env, const char *record, jlong length, void *user_data);
</code></pre>
<p>The subscriber function must be of type <code>jvmtiVerboseGCSubscriber</code>, which is declared in <code>ibmjvmti.h</code>.</p>
<p>This function is called with each record of verbose logging data produced by the VM.</p>
<p>The verbose logging record supplied to the subscriber function is valid only for the duration of the function. If the subscriber wants to save the data, the data must be copied elsewhere.</p>
<p>If the subscriber function returns an error, the alarm function is called, and the subscription is deregistered.</p>
<p><strong>Subscriber function parameters</strong></p>
<ul>
<li><code>jvmti_env</code>: A pointer to the JVMTI environment.</li>
<li><code>record</code>: An ASCII string that contains a verbose log record.</li>
<li><code>length</code>: The number of ASCII characters in the verbose log record.</li>
<li><code>user_data</code>: User data supplied when the subscriber is registered.</li>
</ul>
</dd>
</dl>
<h4 id="jvmtiverbosegcalarm-function"><code>jvmtiVerboseGCAlarm</code> function</h4>
<dl>
<dd>
<p>The alarm function type is defined as follows:</p>
<pre><code>typedef jvmtiError (*jvmtiVerboseGCAlarm)(jvmtiEnv *jvmti_env, void *subscription_id, void *user_data);
</code></pre>
<p>The alarm function must be of type <code>jvmtiVerboseGCAlarm</code>, which is declared in <code>ibmjvmti.h</code>. This function is called if the subscriber function returns an error.</p>
<p><strong>Alarm function parameters</strong></p>
<ul>
<li><code>jvmti_env</code>: A pointer to the JVMTI environment.</li>
<li><code>user_data</code>: User data supplied when the subscriber is registered.</li>
<li><code>subscription_id</code>: The subscription identifier.</li>
</ul>
</dd>
</dl>
<hr />
<!-- ==================================================================================================== -->
<h3 id="deregisterverbosegcsubscriber"><code>DeregisterVerboseGCSubscriber</code></h3>
<p>You can unsubscribe from verbose Garbage Collection (GC) data logging by using the <code>DeregisterVerboseGCSubscriber()</code> API:</p>
<pre><code>jvmtiError DeregisterVerboseGCSubscriber(jvmtiEnv* jvmti_env, void *userData, void *subscription_id)
</code></pre>
<p>After the <code>DeregisterVerboseGCSubscriber()</code> API is called, no further calls are made to the previously registered subscriber function.</p>
<p><strong>Parameters</strong></p>
<ul>
<li><code>jvmti_env</code>: A pointer to the JVMTI environment.</li>
<li><code>subscription_id</code>: The subscription identifier that is returned by the call to the <a href="#registerverbosegcsubscriber">RegisterVerboseGCSubscriber()</a> API.</li>
</ul>
<p><strong>Returns</strong></p>
<p><code>JVMTI_ERROR_NONE</code>: Success.<br />
<code>JVMTI_ERROR_NULL_POINTER</code>: The <code>subscription_id</code> parameter is null.<br />
<code>JVMTI_ERROR_OUT_OF_MEMORY</code>: There is insufficient system memory to process the request.<br />
<code>JVMTI_ERROR_INVALID_ENVIRONMENT</code>: The <code>jvmti_env</code> parameter is not valid.<br />
<code>JVMTI_ERROR_WRONG_PHASE</code>: The extension has been called outside the JVMTI live phase.</p>
<p><strong>Identifiers</strong></p>
<p>JVMTI Extension Function identifier: <code>com.ibm.DeregisterVerboseGCSubscriber</code><br />
Macro declaration in the <code>ibmjvmti.h</code> file: <code>COM_IBM_DEREGISTER_VERBOSEGC_SUBSCRIBER</code></p>
<hr />
<!-- ==================================================================================================== -->
<!-- ==== END OF TOPIC ==== interface_jvmti.md ==== -->
<!--
-->
<!-- This block was originally in the theme's 'footer.html' partial file. It has been moved here in part to resolve issues with the footer being too large. -->
</article>
</div>
</div>
</main>
<!--
* Copyright (c) 2017, 2021 IBM Corp. and others
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution and is available at
* https://www.eclipse.org/legal/epl-2.0/ or the Apache
* License, Version 2.0 which accompanies this distribution and
* is available at https://www.apache.org/licenses/LICENSE-2.0.
*
* This Source Code may also be made available under the
* following Secondary Licenses when the conditions for such
* availability set forth in the Eclipse Public License, v. 2.0
* are satisfied: GNU General Public License, version 2 with
* the GNU Classpath Exception [1] and GNU General Public
* License, version 2 with the OpenJDK Assembly Exception [2].
*
* [1] https://www.gnu.org/software/classpath/license.html
* [2] http://openjdk.java.net/legal/assembly-exception.html
*
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH
* Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception
-->
<cite></cite>
<footer class="footer">
<div class="md-footer-meta">
<div class="above-line">
<div class="above-line-links">
<div class="column">
<h3 >Docs</h3>
<span class="footer-link"><a href="/openj9/docs/openj9_newuser/" >New to OpenJ9?</a></span>
<span class="footer-link"><a href="/openj9/docs/introduction/">Getting started</a></span>
<span class="footer-link"><a href="/openj9/docs/cmdline_specifying/">Command-line options</a></span>
</div>
<div class="column">
<h3>Resources</h3>
<span class="footer-link"><a href="https://www.eclipse.org/openj9/about/" rel="noopener noreferrer" target="_blank">About</a></span>
<span class="footer-link"><a href="https://www.eclipse.org/openj9/performance/" rel="noopener noreferrer" target="_blank">Performance</a></span>
</div>
<div class="column">
<h3 >Community</h3>
<span class="footer-link"><a href="https://www.eclipse.org/openj9/news/" rel="noopener noreferrer" target="_blank">News</a></span>
<span class="footer-link"><a href="https://blog.openj9.org/" rel="noopener noreferrer" target="_blank">Blogs</a></span>
</div>
</div>
<div class="column-incubator">
<div class="arrange-column">
<h3 ><b>OpenJ9 is an Eclipse Incubator project</b></h3>
<a class="incubator-image" href="http://wiki.eclipse.org/Development_Resources/Process_Guidelines/What_is_Incubation" target="_blank"><img width="50px" src="../cr/incubator-logo.svg" alt="Eclipse Incubation"></a>
</div>
</div>
</div>
<div class="horizontal-line"></div>
<div class="below-line">
<span class="below-line-links"><a href="https://www.eclipse.org/" rel="noopener noreferrer" target="_blank">Eclipse Foundation Website </a></span>
<span class="below-line-links"><a href="https://www.eclipse.org/legal/privacy.php" rel="noopener noreferrer" target="_blank">Privacy Policy</a></span>
<span class="below-line-links"><a href="https://www.eclipse.org/legal/termsofuse.php" rel="noopener noreferrer" target="_blank">Terms of Use</a></span>
<span class="below-line-links"><a href="https://www.eclipse.org/legal/copyright.php" rel="noopener noreferrer" target="_blank">Copyright Agent</a></span>
<span class="below-line-links"><a href="https://www.eclipse.org/legal/" rel="noopener noreferrer" target="_blank">Legal</a></span>
<div class="below-line-social-media-icons">
<span class="social-media-link"> <a href="https://twitter.com/openj9/" rel="noopener noreferrer" target="_blank"> <img src="../cr/twitter-logo.svg" alt="Twitter Logo"></img></a></span>
<span class="social-media-link"> <a href="https://github.com/eclipse/openj9" rel="noopener noreferrer" target="_blank"> <img src="../cr/github-logo.svg" alt="GitHub Logo"></img></a></span>
<span class="social-media-link"> <a href="https://openj9.slack.com/" rel="noopener noreferrer" target="_blank"><img src="../cr/slack-icon.svg" alt="Slack logo"></img></a></span>
<span class="social-media-link"> <a href="https://stackoverflow.com/search?q=%23OpenJ9" rel="noopener noreferrer" target="_blank"><img src="../cr/stackoverflow-logo.svg" alt="Stack Overflow logo"></img></a></span>
</div>
</div>
</div>
</footer>
</div>
<script src="../assets/javascripts/application.a8b5e56f.js"></script>
<script>app.initialize({version:"1.0.4",url:{base:".."}})</script>
<script src="../javascripts/oj9.js"></script>
<script>
window.ga = window.ga || function() {
(ga.q = ga.q || []).push(arguments)
}
ga.l = +new Date
/* Setup integration and send page view */
ga("create", "UA-105616558-3", "mkdocs.org")
ga("set", "anonymizeIp", true)
ga("send", "pageview")
/* Register handler to log search on blur */
document.addEventListener("DOMContentLoaded", () => {
if (document.forms.search) {
var query = document.forms.search.query
query.addEventListener("blur", function() {
if (this.value) {
var path = document.location.pathname;
ga("send", "pageview", path + "?q=" + this.value)
}
})
}
})
</script>
<script async src="https://www.google-analytics.com/analytics.js"></script>
</body>
</html>