Java Reference
In-Depth Information
Table A-7. Flags for memory management
Flag
What it does
When to use it
See also
Generates a heap
dump when the JVM
throws an out of
memory error.
Enable this flag if the application
throws out of memory errors due to
the heap space or permgen, so the heap
can be analyzed for memory leaks.
Out of
Memory
Errors
-
XX:+HeapDumpOnOutOfMemoryError
Specifies the file-
name where auto-
matic heap dumps
should be written.
To specify a path other than
java_pid<pid>.hprof for heap dumps
generated on out of memory errors or
GC events (when those options have
been enabled).
Out of
Memory
Errors
-XX:HeapDumpPath=<path>
-XX:SoftRefLRUPolicyMSPerMB= N Controls how long
soft references sur-
vive after being used.
Decrease this value to clean up soft
references more quickly, particularly
in low-memory conditions.
Weak, Soft,
and Other
References
Controls how much
native memory can
be allocated via the
allocateDirect()
method of the
ByteBuffer class.
Consider setting this if you want to
limit the amount of direct memory a
program can allocate. Note that it is no
longer necessary to set this flag to al-
locate more than 64 MB of direct
memory.
Footprint
-XX:MaxDirectMemorySize= N
Directs the JVM to
allocate pages from
the operating sys-
tem's large page sys-
tem, if applicable.
If supported by the OS, this option
will generally improve performance.
Large Pages
-XX:+UseLargePages
Directs the JVM to
allocate large pages
of the given size
(Solaris only).
On large Solaris systems, increase this
value (to, say, 256 MB) for best per-
formance.
Large Pages
-XX:+LargePageSizeInBytes= N
Sets the size of the
hashtable the JVM
uses to hold interned
strings.
Increase this value if the application
performs a significant amount of string
interning.
String In-
terning
-XX:+StringTableSize= N
Emulates 35-bit
pointers for object
references.
This is the default for heaps that are
less than 32 GB in size; there is never
an advantage to disabling it.
Compressed
oops
-XX:+UseCompressedOops
Search WWH ::




Custom Search