Professional Documents
Culture Documents
JPA 2.0
By Mike Keith
#127
DZone, Inc.
www.dzone.com
#162
CONTENTS INCLUDE:
n
Configuration
JMX
Available Plugins
JVM Settings
and More!
Tomcat:
ABOUT VISUALVM
Jetty standalone:
java <JMX configuration parameters> -jar start.jar etc/jetty-jmx.xml
CONFIGURATION
Maven:
Repositories
Windows 7: C:\Users\[userId]\AppData\Roaming\.visualvm\[version]\
repository\
oS X: /Users/[userId]/Library/Application Support/visualvm/[version]/
repository/
User Directory
Windows 7: C:\Users\[userId]\AppData\Roaming\.visualvm\[version]\
oS X: /Users/[userId]/Library/Application Support/visualvm/[version]/
Message logs
Windows 7: C:\Users\[userId]\AppData\Roaming\.visualvm\[version]\var\
log\message.log
oS X: /Users/[userId]/Library/Application Support/visualvm/[version]/var/
log/message.log
JMX
JMX connections
Default connection:
<hostname>:<port>
Detailed connection:
service:jmx:<protocol>:<sap>
Name
Parameter
Access file
-Dcom.sun.management.jmxremote.access.file=<access
file>
Authenticate
-Dcom.sun.management.jmxremote.authenticate=<true
/ false>
Debug
-Djavax.net.debug=<level>
JMX port
-Dcom.sun.management.jmxremote.port=<PortNumber>
JMX remote
enabled
-Dcom.sun.management.jmxremote
* Keystore file
-Djavax.net.ssl.keyStore=<keystore file>
* Keystore
password
-Djavax.net.ssl.keyStorePassword=<password>
Management
level
-Djavax.management.level=<level>
Password file
-Dcom.sun.management.jmxremote.password
file=<password file>
RMI server
hostname
-Djava.rmi.server.hostname=<public.ip.address>
SSL enabled
-Dcom.sun.management.jmxremote.ssl=<true / false>
DZone, Inc.
www.dzone.com
Name
Parameter
Name
Description
* Truststore
file
-Djavax.net.ssl.trustStore=<truststore file>
JVM Probes
* Truststore
password
-Djavax.net.ssl.trustStorePassword=<password>
Jvmstat Probes
Swing Probes
JavaFX Probes
DTrace Probes
AVAILABLE PLUGINS
Stable Plugins
Name
Description
MBean Browser
Visual GC Plugin
Tracer
Thread Inspector
BTrace
VisualVM Extensions
Security
Buffer Monitor
JConsole Plugins
System Tray
JVM Capabilities
Java ME Profiler
Snapshot Viewer
JConsole plugins
container
Description
Monitor Probes
DZone, Inc.
Hibernate
Name
Description
Glassfish
OQL Syntax
Support
Name
Description
OSGI
GCViewer
Hot
Tip
Tracer probes
Name
Top Threads
Third-Party Plugins
Description
JTop
Plugins in development
Kill Applications
Name
www.dzone.com
Java stack
The Java stack space consists of local variables, method calls, arguments,
reference variables, intermediate computations, and return values, if any,
corresponding to the method invoked. Primitive data type variables such as
int, long, float and double are also stored in the stack space.
Every thread, including the main thread and daemon threads, gets its own
stack space but will share the same heap space.
Description
-Xms<n[k|m]>
-Xmx<n[k|m]>
-Xss<n[k|m]>
Behavioral Options
Java heap
Description
-XX:-AllowUserSignalHandlers
-XX:AltStackSize=<n[k|m]>
[default = 16384]
-XX:-DisableExplicitGC
Java JVM settings and details for tuning, tracing and debugging a Java
Virtual Machine (JVM)
-XX:+FailOverToOldVerifier
-XX:+HandlePromotionFailure
-XX:+MaxFDLimit
-XX:PreBlockSpin=<n>
JVM SETTINGS
[default = 10]
Useful XX Options
-XX:-RelaxAccessControlCheck
-XX:+ScavengeBeforeFullGC
-XX:+UseAltSigs
-XX:+UseBoundThreads
-XX:-UseConcMarkSweepGC
-XX:+UseGCOverheadLimit
-XX:+UseLWPSynchronization
-XX:-UseParallelGC
Java heap options are used to specify initial and max heap size and
thread stack size while running Java programs.
Behavioral options change the basic behavior of the VM.
Garbage First (G1) Garbage Collection Options
DZone, Inc.
www.dzone.com
Description
Description
-XX:-UseParallelOldGC
-XX:G1HeapRegionSize=<n[k|m]>
-XX:-UseSerialGC
-XX:-UseSpinning
-XX:+UseTLAB
-XX:+UseSplitVerifier
-XX:+UseThreadPriorities
-XX:+UseVMInterruptibleIO
-XX:-UseParNewGC
-Xincgc
Performance Options
Option & default value
Description
-XX:+AggressiveOpts
-XX:CompileThreshold=<n>
[default = 10000]
[-client: 1,500]
-XX:LargePageSizeInBytes=<n[k
|m]>
-XX:MaxHeapFreeRatio=<n>
-XX:+UseG1GC
-XX:MaxGCPauseMillis=<n>
-XX:InitiatingHeapOccupancyPerc
ent=<n>
[default = 45]
[A value of 0 denotes 'do constant
GC cycles'.]
-XX:NewRatio=<n>
-XX:MinHeapFreeRatio=<n>
[default = 40]
-XX:NewRatio=<n>
-XX:NewSize=<n[k|m]>
Maximum value for tenuring
threshold.
-XX:G1ReservePercent=<n>
-XX:ReservedCodeCacheSize=<n
[k|m]>
[default = 32m]
[Solaris 64-bit, amd64, and -server
x86: 48m; in 1.5.0_06 and earlier,
Solaris 64-bit and and64: 1024m.]
-XX:SurvivorRatio=<n>
[default = 8]
[Solaris amd64: 6; Sparc in 1.3.1: 25;
other Solaris platforms in 5.0 and
earlier: 32]
-XX:TargetSurvivorRatio=<n>
[default = 50]
DZone, Inc.
[default = 2.125m]
[5.0 and newer: 64 bit VMs are
scaled 30% larger; x86: 1m; x86, 5.0
and older: 640k]
[default = 2]
[Sparc -client: 8; x86 -server: 8; x86
-client: 12.]-client: 4 (1.3) 8 (1.3.1+),
x86: 12]
-XX:ConcGCThreads=<n>
[default = 10]
[default = 64m]
[5.0 and newer: 64 bit VMs are
scaled 30% larger; 1.4 amd64: 96m;
1.3.1 -client: 32m.]
[default = 15]
-XX:ParallelGCThreads=<n>
-XX:PermSize=<n[k|m]>
-XX:MaxPermSize=<n[k|m]>
[default = 8]
-XX:MaxTenuringThreshold=<n>
[default = 64mb]
[default = 2]
-XX:SurvivorRatio=<n>
[default = 70]
-XX:MaxNewSize=<n>
Description
[default = 4m]
[amd64: 2m.]
www.dzone.com
Description
Description
-XX:ThreadStackSize=<n>
-XX:OnOutOfMemoryError="<cmd
args>;
<cmd args>"
-XX:-PrintClassHistogram
-XX:-PrintConcurrentLocks
-XX:-PrintCommandLineFlags
-XX:-PrintCompilation
-XX:-PrintGC
-XX:-PrintGCDetails
-XX:-PrintGCTimeStamps
-XX:-PrintTenuringDistribution
-XX:-TraceClassLoading
-XX:-TraceClassLoadingPreorder
-XX:-TraceClassResolution
-XX:-TraceClassUnloading
-XX:-TraceLoaderConstraints
-XX:+PerfSaveDataToFile
-XX:ParallelGCThreads=<n>
[default = 512]
[Sparc: 512; Solaris x86: 320 (was
256 prior in 5.0 and earlier); Sparc
64 bit: 1024; Linux amd64: 1024
(was 0 in 5.0 and earlier); all others
0.]
-XX:+UseBiasedLocking
[5.0: false]
-XX:+UseFastAccessorMethods
-XX:-UseISM
-XX:+UseMPSS
-XX:+UseStringCache
-XX:AllocatePrefetchLines=<n>
-XX:+OptimizeStringConcat
-XX:+UseCompressedOops
-XX:+AlwaysPreTouch
-XX:AllocatePrefetchDistance=<n>
Debugging Options
Option & default value
Description
-XX:-CITime
-XX:ErrorFile=./hs_err_pid<pid>.log
-XX:-ExtendedDTraceProbes
Enable performance-impacting
dtrace probes. (Introduced in 6.
Relevant to Solaris only.)
-XX:HeapDumpPath=./java_
pid<pid>.hprof
-XX:HeapDumpOnOutOfMemoryError
-XX:OnError="<cmd args>;<cmd
args>"
DZone, Inc.
-XX:InlineSmallCode=<n>
[The default value varies with the
platform on which the JVM is
running.]
www.dzone.com
Description
Description
-XX:MaxInlineSize=<n>
-XX:+PrintGCApplicationConcurre
ntTime
-XX:+PrintGCApplicationStopped
Time
-Xdebug -Xnoagent
-Xrunjdwp:transport=dt_socket,serv
er=y,suspend=n,address=<port>
-XX:HeapDumpPath=./java_pid.
hprof
-XX:-PrintCommandLineFlags
-XX:-PrintConcurrentLocks
[default = 35]
-XX:FreqInlineSize=<n>
[The default value varies with the
platform on which the JVM is
running.]
-XX:LoopUnrollLimit=<n>
[The default value varies with the
platform on which the JVM is
running.]
-XX:InitialTenuringThreshold=<n>
[default = 7]
-XX:MaxTenuringThreshold=<n>
[The default value is 15 for the
parallel collector and is 4 for CMS.
The current largest value is 15.]
-verbose:gc
Hot
Tip
Additional Resources
http://java.dzone.com/articles/visualvm-refcard-additional
RECOMMENDED BOOK
Free PDF
Scala Collections
MongoDB
Modularity Patterns
PHP 5.4
DZone, Inc.
150 Preston Executive Dr.
Suite 201
Cary, NC 27513
Copyright 2012 DZone, Inc. All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by means electronic, mechanical, photocopying, or otherwise, without prior
written permission of the publisher.
888.678.0399
919.678.0300
Refcardz Feedback Welcome
$7.95
refcardz@dzone.com
Sponsorship Opportunities
sales@dzone.com
Version 1.0