src/demo/share/jvmti/index.html

Print this page
rev 10532 : [mq]: 8043936-hprof-demo


  37 Every JDK installation should include all the pre-built binaries and sources for
  38 all these agents, just look in the demo/jvmti directory of your JDK.
  39 
  40 
  41 <h2>Using or Running These Agents</h2>
  42 
  43 <p>
  44 Using these agents will require the VM to locate the shared library file
  45 before any actual Java code is run.
  46 The JDK installation should contain all the agent libraries in 
  47 the ${JAVA_HOME}/demo/jvmti/<i>agent-name</i>/lib directories.
  48 The Solaris 64bit version would be contained in the sparcv9 or amd64
  49 subdirectory.
  50 If 'java' complains that it can't find the library,
  51 you may need to add the directory containing the library into the
  52 LD_LIBRARY_PATH environment variable (Unix), or the PATH environment
  53 variable (Windows).
  54 This is system and platform specific.
  55 If you are using 64bit Solaris (e.g. 'java -d64'), 
  56 you should use LD_LIBRARY_PATH64.
  57 Some agents such as hprof (heap/cpu profiler) and jdwp (debugger backend)
  58 are located inside the primary JDK directories and will always be found
  59 in those locations.
  60 
  61 <p>
  62 The agents that instrument classfiles 
  63 (i.e. BCI, usually through the java_crw_demo library) 
  64 such as hprof, heapTracker, mtrace, and minst, 
  65 also need to have the Java classes they use available in the bootclasspath.
  66 The one used by hprof is already in the bootclasspath, and the
  67 other agents will make attempts at automatically adding their jar file
  68 (e.g. heapTracker.jar, mtrace.jar, or minst.jar) to the bootclasspath
  69 with AddToBootstrapClassLoaderSearch from JVM TI at startup
  70 (see the agent_util code).
  71 This is done by locating this jar file at 
  72 ${JAVA_HOME}/demo/jvmti/<i>agent-name</i>
  73 where JAVA_HOME is obtained by calling GetSystemProperty from JVM TI
  74 with "java.home".
  75 We recognize that this is not ideal, but felt that as just demonstration
  76 code it was acceptable.
  77 Ideally the agent could find out the actual directory it came from and
  78 locate the jar file relative to that location. 
  79 Our demonstration agents currently do not do this.
  80 
  81 <p>
  82 If you choose to modify or change these agents, the above information
  83 is important in making everything is found.
  84 It is recommended that you change the name of the agent when you
  85 modify it to avoid conflicts with the existing demo agents.
  86 Or better yet, go to http://jdk.dev.java.net and submit your
  87 changes to the agent as an RFE to the JDK.


 133 <A HREF="heapViewer">heapViewer</A>
 134 <br>
 135 This is a small agent that does some basic heap inspections.
 136 </li>
 137 
 138 <li>
 139 <A HREF="heapTracker">heapTracker</A>
 140 <br>
 141 This is a small agent that does BCI to capture object creation
 142 and track them.
 143 It uses Bytecode Instrumentation (BCI) via the java_crw_demo library.
 144 </li>
 145 
 146 <li>
 147 <A HREF="waiters">waiters</A>
 148 <br>
 149 This is a small agent that gets information about threads
 150 waiting on monitors.
 151 </li>
 152 
 153 <li>
 154 <A HREF="hprof">hprof</A>
 155 <br>
 156 This is a large agent that does heap and cpu profiling.
 157 This demo agent is actually built into the 
 158 
 159 Java Runtime Environment (JRE).
 160 It uses Bytecode Instrumentation (BCI) via the java_crw_demo library.
 161 <br>
 162 <b>Note:</b> hprof is NOT a small or simple agent, the other smaller demos
 163 should be looked at first.
 164 </li>
 165 
 166 </ul>
 167 
 168 
 169 
 170 <h2>Agent Support</h2>
 171 
 172 <ul>
 173 
 174 <li>
 175 <A HREF="java_crw_demo">java_crw_demo</A>
 176 <br>
 177 This is a demo C library that does class file to class file
 178 transformations or BCI (Bytecode Instrumentation).
 179 It is used by several of the above agents.
 180 </li>
 181 
 182 
 183 </ul>
 184 
 185 




  37 Every JDK installation should include all the pre-built binaries and sources for
  38 all these agents, just look in the demo/jvmti directory of your JDK.
  39 
  40 
  41 <h2>Using or Running These Agents</h2>
  42 
  43 <p>
  44 Using these agents will require the VM to locate the shared library file
  45 before any actual Java code is run.
  46 The JDK installation should contain all the agent libraries in 
  47 the ${JAVA_HOME}/demo/jvmti/<i>agent-name</i>/lib directories.
  48 The Solaris 64bit version would be contained in the sparcv9 or amd64
  49 subdirectory.
  50 If 'java' complains that it can't find the library,
  51 you may need to add the directory containing the library into the
  52 LD_LIBRARY_PATH environment variable (Unix), or the PATH environment
  53 variable (Windows).
  54 This is system and platform specific.
  55 If you are using 64bit Solaris (e.g. 'java -d64'), 
  56 you should use LD_LIBRARY_PATH64.
  57 Some agents such as the jdwp (debugger backend)
  58 are located inside the primary JDK directories and will always be found
  59 in those locations.
  60 
  61 <p>
  62 The agents that instrument classfiles 
  63 (i.e. BCI, usually through the java_crw_demo library) 
  64 such as heapTracker, mtrace, and minst, 
  65 also need to have the Java classes they use available in the bootclasspath.
  66 The agents will make attempts at automatically adding their jar file

  67 (e.g. heapTracker.jar, mtrace.jar, or minst.jar) to the bootclasspath
  68 with AddToBootstrapClassLoaderSearch from JVM TI at startup
  69 (see the agent_util code).
  70 This is done by locating this jar file at 
  71 ${JAVA_HOME}/demo/jvmti/<i>agent-name</i>
  72 where JAVA_HOME is obtained by calling GetSystemProperty from JVM TI
  73 with "java.home".
  74 We recognize that this is not ideal, but felt that as just demonstration
  75 code it was acceptable.
  76 Ideally the agent could find out the actual directory it came from and
  77 locate the jar file relative to that location. 
  78 Our demonstration agents currently do not do this.
  79 
  80 <p>
  81 If you choose to modify or change these agents, the above information
  82 is important in making everything is found.
  83 It is recommended that you change the name of the agent when you
  84 modify it to avoid conflicts with the existing demo agents.
  85 Or better yet, go to http://jdk.dev.java.net and submit your
  86 changes to the agent as an RFE to the JDK.


 132 <A HREF="heapViewer">heapViewer</A>
 133 <br>
 134 This is a small agent that does some basic heap inspections.
 135 </li>
 136 
 137 <li>
 138 <A HREF="heapTracker">heapTracker</A>
 139 <br>
 140 This is a small agent that does BCI to capture object creation
 141 and track them.
 142 It uses Bytecode Instrumentation (BCI) via the java_crw_demo library.
 143 </li>
 144 
 145 <li>
 146 <A HREF="waiters">waiters</A>
 147 <br>
 148 This is a small agent that gets information about threads
 149 waiting on monitors.
 150 </li>
 151 













 152 </ul>
 153 
 154 
 155 
 156 <h2>Agent Support</h2>
 157 
 158 <ul>
 159 
 160 <li>
 161 <A HREF="java_crw_demo">java_crw_demo</A>
 162 <br>
 163 This is a demo C library that does class file to class file
 164 transformations or BCI (Bytecode Instrumentation).
 165 It is used by several of the above agents.
 166 </li>
 167 
 168 
 169 </ul>
 170 
 171