jhat.1 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. '\" t
  2. .\" Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
  3. .\" Arch: generic
  4. .\" Software: JDK 8
  5. .\" Date: 21 November 2013
  6. .\" SectDesc: Troubleshooting Tools
  7. .\" Title: jhat.1
  8. .\"
  9. .if n .pl 99999
  10. .TH jhat 1 "21 November 2013" "JDK 8" "Troubleshooting Tools"
  11. .\" -----------------------------------------------------------------
  12. .\" * Define some portability stuff
  13. .\" -----------------------------------------------------------------
  14. .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  15. .\" http://bugs.debian.org/507673
  16. .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
  17. .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  18. .ie \n(.g .ds Aq \(aq
  19. .el .ds Aq '
  20. .\" -----------------------------------------------------------------
  21. .\" * set default formatting
  22. .\" -----------------------------------------------------------------
  23. .\" disable hyphenation
  24. .nh
  25. .\" disable justification (adjust text to left margin only)
  26. .ad l
  27. .\" -----------------------------------------------------------------
  28. .\" * MAIN CONTENT STARTS HERE *
  29. .\" -----------------------------------------------------------------
  30. .SH NAME
  31. jhat \- Analyzes the Java heap\&. This command is experimental and unsupported\&.
  32. .SH SYNOPSIS
  33. .sp
  34. .nf
  35. \fBjhat\fR [ \fIoptions\fR ] \fIheap\-dump\-file\fR
  36. .fi
  37. .sp
  38. .TP
  39. \fIoptions\fR
  40. The command-line options\&. See Options\&.
  41. .TP
  42. \fIheap-dump-file\fR
  43. Java binary heap dump file to be browsed\&. For a dump file that contains multiple heap dumps, you can specify which dump in the file by appending \f3#<number>\fR to the file name, for example, \f3myfile\&.hprof#3\fR\&.
  44. .SH DESCRIPTION
  45. The \f3jhat\fR command parses a Java heap dump file and starts a web server\&. The \f3jhat\fR command lets you to browse heap dumps with your favorite web browser\&. The \f3jhat\fR command supports predesigned queries such as show all instances of a known class \f3MyClass\fR, and Object Query Language (OQL)\&. OQL is similar to SQL, except for querying heap dumps\&. Help on OQL is available from the OQL help page shown by the \f3jhat\fR command\&. With the default port, OQL help is available at http://localhost:7000/oqlhelp/
  46. .PP
  47. There are several ways to generate a Java heap dump:
  48. .TP 0.2i
  49. \(bu
  50. Use the \f3jmap -dump\fR option to obtain a heap dump at runtime\&. See jmap(1)\&.
  51. .TP 0.2i
  52. \(bu
  53. Use the \f3jconsole\fR option to obtain a heap dump through \f3HotSpotDiagnosticMXBean\fR at runtime\&. See jconsole(1) and the \f3HotSpotDiagnosticMXBean\fR interface description at http://docs\&.oracle\&.com/javase/8/docs/jre/api/management/extension/com/sun/management/HotSpotDiagnosticMXBean\&.html
  54. .TP 0.2i
  55. \(bu
  56. Heap dump is generated when an \f3OutOfMemoryError\fR is thrown by specifying the \f3-XX:+HeapDumpOnOutOfMemoryError\fR Java Virtual Machine (JVM) option\&.
  57. .TP 0.2i
  58. \(bu
  59. Use the \f3hprof\fR command\&. See the HPROF: A Heap/CPU Profiling Tool at http://docs\&.oracle\&.com/javase/8/docs/technotes/samples/hprof\&.html
  60. .SH OPTIONS
  61. .TP
  62. -stack false|true
  63. .br
  64. Turns off tracking object allocation call stack\&. If allocation site information is not available in the heap dump, then you have to set this flag to \f3false\fR\&. The default is \f3true\fR\&.
  65. .TP
  66. -refs false|true
  67. .br
  68. Turns off tracking of references to objects\&. Default is \f3true\fR\&. By default, back pointers, which are objects that point to a specified object such as referrers or incoming references, are calculated for all objects in the heap\&.
  69. .TP
  70. -port \fIport-number\fR
  71. .br
  72. Sets the port for the \f3jhat\fR HTTP server\&. Default is 7000\&.
  73. .TP
  74. -exclude \fIexclude-file\fR
  75. .br
  76. Specifies a file that lists data members that should be excluded from the reachable objects query\&. For example, if the file lists \f3java\&.lang\&.String\&.value\fR, then, then whenever the list of objects that are reachable from a specific object \f3o\fR are calculated, reference paths that involve \f3java\&.lang\&.String\&.value\fR field are not considered\&.
  77. .TP
  78. -baseline \fIexclude-file\fR
  79. .br
  80. Specifies a baseline heap dump\&. Objects in both heap dumps with the same object ID are marked as not being new\&. Other objects are marked as new\&. This is useful for comparing two different heap dumps\&.
  81. .TP
  82. -debug \fIint\fR
  83. .br
  84. Sets the debug level for this tool\&. A level of 0 means no debug output\&. Set higher values for more verbose modes\&.
  85. .TP
  86. -version
  87. .br
  88. Reports the release number and exits
  89. .TP
  90. -h
  91. .br
  92. Dsiplays a help message and exits\&.
  93. .TP
  94. -help
  95. .br
  96. Displays a help message and exits\&.
  97. .TP
  98. -J\fIflag\fR
  99. .br
  100. Passes \f3flag\fR to the Java Virtual Machine on which the \f3jhat\fR command is running\&. For example, \f3-J-Xmx512m\fR to use a maximum heap size of 512 MB\&.
  101. .SH SEE\ ALSO
  102. .TP 0.2i
  103. \(bu
  104. jmap(1)
  105. .TP 0.2i
  106. \(bu
  107. jconsole(1)
  108. .TP 0.2i
  109. \(bu
  110. HPROF: A Heap/CPU Profiling Tool at http://docs\&.oracle\&.com/javase/8/docs/technotes/samples/hprof\&.html
  111. .RE
  112. .br
  113. 'pl 8.5i
  114. 'bp