Skip to content

Commit cd15ebb

Browse files
David Holmeststuefe
David Holmes
andcommittedDec 23, 2024
8346477: Clarify the Java manpage in relation to the JVM's OnOutOfMemoryError flags
Co-authored-by: Thomas Stuefe <stuefe@openjdk.org> Reviewed-by: jpai, stuefe
1 parent bffa77b commit cd15ebb

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed
 

‎src/java.base/share/man/java.md

+11-2
Original file line numberDiff line numberDiff line change
@@ -1292,10 +1292,15 @@ These `java` options control the runtime behavior of the Java HotSpot VM.
12921292

12931293
`-XX:OnOutOfMemoryError=`*string*
12941294
: Sets a custom command or a series of semicolon-separated commands to run
1295-
when an `OutOfMemoryError` exception is first thrown. If the string
1295+
when an `OutOfMemoryError` exception is first thrown by the JVM.
1296+
If the string
12961297
contains spaces, then it must be enclosed in quotation marks. For an
12971298
example of a command string, see the description of the `-XX:OnError`
12981299
option.
1300+
This applies only to `OutOfMemoryError` exceptions caused by Java Heap
1301+
exhaustion; it does not apply to `OutOfMemoryError` exceptions thrown
1302+
directly from Java code, nor by the JVM for other types of resource
1303+
exhaustion (such as native thread creation errors).
12991304

13001305
`-XX:+PrintCommandLineFlags`
13011306
: Enables printing of ergonomically selected JVM flags that appeared on the
@@ -2189,10 +2194,14 @@ perform extensive debugging.
21892194
`-XX:+HeapDumpOnOutOfMemoryError`
21902195
: Enables the dumping of the Java heap to a file in the current directory by
21912196
using the heap profiler (HPROF) when a `java.lang.OutOfMemoryError`
2192-
exception is thrown. You can explicitly set the heap dump file path and
2197+
exception is thrown by the JVM. You can explicitly set the heap dump file path and
21932198
name using the `-XX:HeapDumpPath` option. By default, this option is
21942199
disabled and the heap isn't dumped when an `OutOfMemoryError` exception is
21952200
thrown.
2201+
This applies only to `OutOfMemoryError` exceptions caused by Java Heap
2202+
exhaustion; it does not apply to `OutOfMemoryError` exceptions thrown
2203+
directly from Java code, nor by the JVM for other types of resource
2204+
exhaustion (such as native thread creation errors).
21962205

21972206
`-XX:HeapDumpPath=`*path*
21982207
: Sets the path and file name for writing the heap dump provided by the heap

0 commit comments

Comments
 (0)
Please sign in to comment.