Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
jstatJavaVirtualMachineStatisticsMonitoringTool
jstatJavaVirtualMachineStatisticsMonitoringTool
Synopsis
Parameters
Description
VirtualMachineIdentifier
Options
GeneralOptions
OutputOptions
Examples
SeeAlso
SYNOPSIS
jstat[generalOption|outputOptionsvmid[interval[s|ms][count]]]
PARAMETERS
generalOption
Asinglegeneralcommandlineoption(helporoptions)
outputOptions
Oneormoreoutputoptions,consistingofasinglestatOption,plusanyofthet,h,andJoptions.
vmid
Virtualmachineidentifier,astringindicatingthetargetJavavirtualmachine(JVM).Thegeneralsyntaxis
[protocol:][//]lvmid[@hostname[:port]/servername]
ThesyntaxofthevmidstringlargelycorrespondstothesyntaxofaURI.Thevmidcanvaryfromasimpleintegerrepresentingalocal
JVMtoamorecomplexconstructionspecifyingacommunicationsprotocol,portnumber,andotherimplementationspecificvalues.See
VirtualMachineIdentifierfordetails.
interval[s|ms]
Samplingintervalinthespecifiedunits,seconds(s)ormilliseconds(ms).Defaultunitsaremilliseconds.Mustbeapositiveinteger.If
specified,jstatwillproduceitsoutputateachinterval.
count
Numberofsamplestodisplay.Defaultvalueisinfinitythatis,jstatdisplaysstatisticsuntilthetargetJVMterminatesorthejstat
commandisterminated.Mustbeapositiveinteger.
DESCRIPTION
ThejstattooldisplaysperformancestatisticsforaninstrumentedHotSpotJavavirtualmachine(JVM).ThetargetJVMisidentifiedbyitsvirtual
machineidentifier,orvmidoptiondescribedbelow.
NOTE:ThisutilityisunsupportedandmaynotbeavailableinfutureversionsoftheJDK.ItisnotcurrentlyavailableonWindows98and
WindowsME.platforms.
VIRTUALMACHINEIDENTIFIER
ThesyntaxofthevmidstringlargelycorrespondstothesyntaxofaURI:
[protocol:][//]lvmid[@hostname][:port][/servername]
protocol
Thecommunicationsprotocol.Iftheprotocolisomittedandahostnameisnotspecified,thedefaultprotocolisaplatformspecific
optimizedlocalprotocol.Iftheprotocolisomittedandahostnameisspecified,thenthedefaultprotocolisrmi.
lvmid
ThelocalvirtualmachineidentifierforthetargetJVM.ThelvmidisaplatformspecificvaluethatuniquelyidentifiesaJVMonasystem.
Thelvmidistheonlyrequiredcomponentofavirtualmachineidentifier.Thelvmidistypically,butnotnecessarily,theoperating
system'sprocessidentifierforthetargetJVMprocess.Youcanusethejpscommandtodeterminethelvmid.Also,youcandetermine
lvmidonUnixplatformswiththepscommand,andonWindowswiththeWindowsTaskManager.
hostname
AhostnameorIPaddressindicatingthetargethost.Ifhostnameisomitted,thenthetargethostisthelocalhost.
port
Thedefaultportforcommunicatingwiththeremoteserver.Ifthehostnameisomittedortheprotocolspecifiesanoptimized,local
protocol,thenportisignored.Otherwise,treatmentoftheportparameterisimplementationspecific.Forthedefaultrmiprotocol,theport
indicatestheportnumberforthermiregistryontheremotehost.Ifportisomitted,andprotocolindicatesrmi,thenthedefaultrmiregistry
https://docs.oracle.com/javase/7/docs/technotes/tools/share/jstat.html
1/6
12/2/2014
jstatJavaVirtualMachineStatisticsMonitoringTool
port(1099)isused.
servername
Thetreatmentofthisparameterdependsonimplementation.Fortheoptimizedlocalprotocol,thisfieldisignored.Forthermiprotocol,
itrepresentsthenameoftheRMIremoteobjectontheremotehost.
OPTIONS
Thejstatcommandsupportstwotypesofoptions,generaloptionsandoutputoptions.Generaloptionscausejstattodisplaysimpleusage
andversioninformation.Outputoptionsdeterminethecontentandformatofthestatisticaloutput.
NOTE:Alloptions,andtheirfunctionalityaresubjecttochangeorremovalinfuturereleases.
GENERALOPTIONS
Ifyouspecifyoneofthegeneraloptions,youcannotspecifyanyotheroptionorparameter.
help
Displayhelpmessage.
options
Displaylistofstatisticsoptions.SeetheOutputOptionssectionbelow.
OUTPUTOPTIONS
Ifyoudonotspecifyageneraloption,thenyoucanspecifyoutputoptions.Outputoptionsdeterminethecontentandformatofjstat'soutput,
andconsistofasinglestatOption,plusanyoftheotheroutputoptions(h,t,andJ).ThestatOptionmustcomefirst.
Outputisformattedasatable,withcolumnsareseparatedbyspaces.Aheaderrowwithtitlesdescribesthecolumns.Usethehoptiontoset
thefrequencyatwhichtheheaderisdisplayed.Columnheadernamesaregenerallyconsistentbetweenthedifferentoptions.Ingeneral,iftwo
optionsprovideacolumnwiththesamename,thenthedatasourceforthetwocolumnsarethesame.
Usethetoptiontodisplayatimestampcolumn,labeledTimestampasthefirstcolumnofoutput.TheTimestampcolumncontainsthe
elapsedtime,inseconds,sincestartupofthetargetJVM.Theresolutionofthetimestampisdependentonvariousfactorsandissubjectto
variationduetodelayedthreadschedulingonheavilyloadedsystems.
Usetheintervalandcountparameterstodeterminehowfrequentlyandhowmanytimes,respectively,jstatdisplaysitsoutput.
NOTE:Youareadvisednottowritescriptstoparsejstat'soutputsincetheformatmaychangeinfuturereleases.Ifyouchoosetowritescripts
thatparsejstatoutput,expecttomodifythemforfuturereleasesofthistool.
statOption
Determinesthestatisticsinformationthatjstatdisplays.Thefollowingtableliststheavailableoptions.Usetheoptionsgeneraloption
todisplaythelistofoptionsforaparticularplatforminstallation.
Option
Displays...
class
compiler
Statisticsonthebehavioroftheclassloader.
StatisticsofthebehavioroftheHotSpotJustinTimecompiler.
gc
gccapacity
Statisticsofthebehaviorofthegarbagecollectedheap.
Statisticsofthecapacitiesofthegenerationsandtheircorrespondingspaces.
gccause
Summaryofgarbagecollectionstatistics(sameasgcutil),withthecauseofthelastandcurrent(if
applicable)garbagecollectionevents.
gcnew
Statisticsofthebehaviorofthenewgeneration.
gcnewcapacity Statisticsofthesizesofthenewgenerationsanditscorrespondingspaces.
gcold
gcoldcapacity
Statisticsofthebehavioroftheoldandpermanentgenerations.
Statisticsofthesizesoftheoldgeneration.
gcpermcapacity Statisticsofthesizesofthepermanentgeneration.
gcutil
Summaryofgarbagecollectionstatistics.
printcompilation HotSpotcompilationmethodstatistics.
hn
Displayacolumnheadereverynsamples(outputrows),wherenisapositiveinteger.Defaultvalueis0,whichdisplaysthecolumn
headerabovethefirstrowofdata.
t
Displayatimestampcolumnasthefirstcolumnofoutput.ThetimestampisthetimesincethestarttimeofthetargetJVM.
JjavaOption
PassjavaOptiontothejavaapplicationlauncher.Forexample,JXms48msetsthestartupmemoryto48megabytes.Foracomplete
listofoptions,seejavatheJavaapplicationlauncher
STATOPTIONSANDOUTPUT
ThefollowingtablessummarizethecolumnsthatjstatoutputsforeachstatOption.
classOption
ClassLoaderStatistics
Column
Description
Loaded
Numberofclassesloaded.
Bytes
NumberofKbytesloaded.
https://docs.oracle.com/javase/7/docs/technotes/tools/share/jstat.html
2/6
12/2/2014
jstatJavaVirtualMachineStatisticsMonitoringTool
Unloaded
Numberofclassesunloaded.
Bytes
NumberofKbytesunloaded.
Time
Timespentperformingclassloadandunloadoperations.
compilerOption
HotSpotJustInTimeCompilerStatistics
Column
Description
Compiled
Numberofcompilationtasksperformed.
Failed
Numberofcompilationtasksthatfailed.
Invalid
Numberofcompilationtasksthatwereinvalidated.
Time
Timespentperformingcompilationtasks.
FailedType
Compiletypeofthelastfailedcompilation.
FailedMethod
Classnameandmethodforthelastfailedcompilation.
gcOption
Garbagecollectedheapstatistics
Column
Description
S0C
Currentsurvivorspace0capacity(KB).
S1C
Currentsurvivorspace1capacity(KB).
S0U
Survivorspace0utilization(KB).
S1U
Survivorspace1utilization(KB).
EC
Currentedenspacecapacity(KB).
EU
Edenspaceutilization(KB).
OC
Currentoldspacecapacity(KB).
OU
Oldspaceutilization(KB).
PC
Currentpermanentspacecapacity(KB).
PU
Permanentspaceutilization(KB).
YGC
NumberofyounggenerationGCEvents.
YGCT
Younggenerationgarbagecollectiontime.
FGC
NumberoffullGCevents.
FGCT
Fullgarbagecollectiontime.
GCT
Totalgarbagecollectiontime.
gccapacityOption
MemoryPoolGenerationandSpaceCapacities
Column
Description
NGCMN
Minimumnewgenerationcapacity(KB).
NGCMX
Maximumnewgenerationcapacity(KB).
NGC
Currentnewgenerationcapacity(KB).
S0C
Currentsurvivorspace0capacity(KB).
S1C
Currentsurvivorspace1capacity(KB).
EC
Currentedenspacecapacity(KB).
OGCMN
Minimumoldgenerationcapacity(KB).
OGCMX
Maximumoldgenerationcapacity(KB).
OGC
Currentoldgenerationcapacity(KB).
OC
Currentoldspacecapacity(KB).
PGCMN
Minimumpermanentgenerationcapacity(KB).
PGCMX
MaximumPermanentgenerationcapacity(KB).
PGC
CurrentPermanentgenerationcapacity(KB).
PC
CurrentPermanentspacecapacity(KB).
YGC
NumberofYounggenerationGCEvents.
FGC
NumberofFullGCEvents.
gccauseOption
Thisoptiondisplaysthesamesummaryofgarbagecollectionstatisticsasthegcutiloption,butincludesthecausesofthelastgarbage
collectioneventand(ifapplicable)thecurrentgarbagecollectionevent.Inadditiontothecolumnslistedforgcutil,thisoptionaddsthe
followingcolumns:
Column
GarbageCollectionStatistics,IncludingGCEvents
Description
LGCC
CauseoflastGarbageCollection.
GCC
CauseofcurrentGarbageCollection.
https://docs.oracle.com/javase/7/docs/technotes/tools/share/jstat.html
3/6
12/2/2014
jstatJavaVirtualMachineStatisticsMonitoringTool
gcnewOption
NewGenerationStatistics
Column
Description
S0C
Currentsurvivorspace0capacity(KB).
S1C
Currentsurvivorspace1capacity(KB).
S0U
Survivorspace0utilization(KB).
S1U
Survivorspace1utilization(KB).
TT
Tenuringthreshold.
MTT
Maximumtenuringthreshold.
DSS
Desiredsurvivorsize(KB).
EC
Currentedenspacecapacity(KB).
EU
Edenspaceutilization(KB).
YGC
NumberofyounggenerationGCevents.
YGCT
Younggenerationgarbagecollectiontime.
gcnewcapacityOption
Column
NewGenerationSpaceSizeStatistics
Description
NGCMN
Minimumnewgenerationcapacity(KB).
NGCMX
Maximumnewgenerationcapacity(KB).
NGC
Currentnewgenerationcapacity(KB).
S0CMX
Maximumsurvivorspace0capacity(KB).
S0C
Currentsurvivorspace0capacity(KB).
S1CMX
Maximumsurvivorspace1capacity(KB).
S1C
Currentsurvivorspace1capacity(KB).
ECMX
Maximumedenspacecapacity(KB).
EC
Currentedenspacecapacity(KB).
YGC
NumberofyounggenerationGCevents.
FGC
NumberofFullGCEvents.
gcoldOption
OldandPermanentGenerationStatistics
Column
Description
PC
Currentpermanentspacecapacity(KB).
PU
Permanentspaceutilization(KB).
OC
Currentoldspacecapacity(KB).
OU
oldspaceutilization(KB).
YGC
NumberofyounggenerationGCevents.
FGC
NumberoffullGCevents.
FGCT
Fullgarbagecollectiontime.
GCT
Totalgarbagecollectiontime.
gcoldcapacityOption
OldGenerationStatistics
Column
Description
OGCMN
Minimumoldgenerationcapacity(KB).
OGCMX
Maximumoldgenerationcapacity(KB).
OGC
Currentoldgenerationcapacity(KB).
OC
Currentoldspacecapacity(KB).
YGC
NumberofyounggenerationGCevents.
FGC
NumberoffullGCevents.
FGCT
Fullgarbagecollectiontime.
GCT
Totalgarbagecollectiontime.
gcpermcapacityOption
PermanentGenerationStatistics
Column
Description
PGCMN
Minimumpermanentgenerationcapacity(KB).
PGCMX
Maximumpermanentgenerationcapacity(KB).
PGC
Currentpermanentgenerationcapacity(KB).
PC
Currentpermanentspacecapacity(KB).
YGC
NumberofyounggenerationGCevents.
https://docs.oracle.com/javase/7/docs/technotes/tools/share/jstat.html
4/6
12/2/2014
jstatJavaVirtualMachineStatisticsMonitoringTool
FGC
NumberoffullGCevents.
FGCT
Fullgarbagecollectiontime.
GCT
Totalgarbagecollectiontime.
gcutilOption
SummaryofGarbageCollectionStatistics
Column
Description
S0
Survivorspace0utilizationasapercentageofthespace'scurrentcapacity.
S1
Survivorspace1utilizationasapercentageofthespace'scurrentcapacity.
Edenspaceutilizationasapercentageofthespace'scurrentcapacity.
Oldspaceutilizationasapercentageofthespace'scurrentcapacity.
Permanentspaceutilizationasapercentageofthespace'scurrentcapacity.
YGC
NumberofyounggenerationGCevents.
YGCT
Younggenerationgarbagecollectiontime.
FGC
NumberoffullGCevents.
FGCT
Fullgarbagecollectiontime.
GCT
Totalgarbagecollectiontime.
printcompilationOption
Column
HotSpotCompilerMethodStatistics
Description
Compiled Numberofcompilationtasksperformedbythemostrecentlycompiledmethod.
Size
Numberofbytesofbytecodeofthemostrecentlycompiledmethod.
Type
Compilationtypeofthemostrecentlycompiledmethod.
Method
Classnameandmethodnameidentifyingthemostrecentlycompiledmethod.Class
nameuses"/"insteadof"."asnamespaceseparator.Methodnameisthemethod
withinthegivenclass.TheformatforthesetwofieldsisconsistentwiththeHotSpot
XX:+PrintComplationoption.
EXAMPLES
ThissectionpresentssomeexamplesofmonitoringalocalJVMwithalvmidof21891.
Usingthegcutiloption
Thisexampleattachestolvmid21891andtakes7samplesat250millisecondintervalsanddisplaystheoutputasspecifiedbythegcutil
option.
jstatgcutil218912507
S0S1EOPYGCYGCTFGCFGCTGCT
12.440.0027.209.4996.70780.17650.4950.672
12.440.0062.169.4996.70780.17650.4950.672
12.440.0083.979.4996.70780.17650.4950.672
0.007.740.009.5196.70790.17750.4950.673
0.007.7423.379.5196.70790.17750.4950.673
0.007.7443.829.5196.70790.17750.4950.673
0.007.7458.119.5196.71790.17750.4950.673
Theoutputofthisexampleshowsthatayounggenerationcollectionoccurredbetweenthe3rdand4thsample.Thecollectiontook0.001
secondsandpromotedobjectsfromtheedenspace(E)totheoldspace(O),resultinginanincreaseofoldspaceutilizationfrom9.49%to
9.51%.Beforethecollection,thesurvivorspacewas12.44%utilized,butafterthiscollectionitisonly7.74%utilized.
Repeatingthecolumnheaderstring
Thisexampleattachestolvmid21891andtakessamplesat250millisecondintervalsanddisplaystheoutputasspecifiedbygcutiloption.In
addition,itusestheh3optiontooutputthecolumnheaderafterevery3linesofdata.
jstatgcnewh321891250
S0CS1CS0US1UTTMTTDSSECEUYGCYGCT
64.064.00.031.7313132.0512.0178.62490.203
64.064.00.031.7313132.0512.0355.52490.203
https://docs.oracle.com/javase/7/docs/technotes/tools/share/jstat.html
5/6
12/2/2014
jstatJavaVirtualMachineStatisticsMonitoringTool
64.064.035.40.023132.0512.021.92500.204
S0CS1CS0US1UTTMTTDSSECEUYGCYGCT
64.064.035.40.023132.0512.0245.92500.204
64.064.035.40.023132.0512.0421.12500.204
64.064.00.019.0313132.0512.084.42510.204
S0CS1CS0US1UTTMTTDSSECEUYGCYGCT
64.064.00.019.0313132.0512.0306.72510.204
Inadditiontoshowingtherepeatingheaderstring,thisexampleshowsthatbetweenthe2ndand3rdsamples,ayoungGCoccurred.Its
durationwas0.001seconds.Thecollectionfoundenoughlivedatathatthesurvivorspace0utilization(S0U)wouldwouldhaveexceededthe
desiredsurvivorSize(DSS).Asaresult,objectswerepromotedtotheoldgeneration(notvisibleinthisoutput),andthetenuringthreshold(TT)
wasloweredfrom31to2.
Anothercollectionoccursbetweenthe5thand6thsamples.Thiscollectionfoundveryfewsurvivorsandreturnedthetenuringthresholdto31.
Includingatimestampforeachsample
Thisexampleattachestolvmid21891andtakes3samplesat250millisecondintervals.Thetoptionisusedtogenerateatimestampforeach
sampleinthefirstcolumn.
jstatgcoldcapacityt218912503
TimestampOGCMNOGCMXOGCOCYGCFGCFGCTGCT
150.11408.060544.011696.011696.0194802.8743.799
150.41408.060544.013820.013820.0194812.9383.863
150.71408.060544.013820.013820.0194812.9383.863
TheTimestampcolumnreportstheelapsedtimeinsecondssincethestartofthetargetJVM.Inaddition,thegcoldcapacityoutputshowsthe
oldgenerationcapacity(OGC)andtheoldspacecapacity(OC)increasingastheheapexpandstomeetallocationand/orpromotiondemands.
Theoldgenerationcapacity(OGC)hasgrowntofrom11696KBto13820KBafterthe81stFullGC(FGC).Themaximumcapacityofthe
generation(andspace)is60544KB(OGCMX),soitstillhasroomtoexpand.
MonitorinstrumentationforaremoteJVM
Thisexampleattachestolvmid40496onthesystemnamedremote.domainusingthegcutiloption,withsamplestakeneverysecond
indefinitely.
jstatgcutil40496@remote.domain1000
...outputomitted
Thelvmidiscombinedwiththenameoftheremotehosttoconstructavmidof40496@remote.domain.Thisvmidresultsintheuseofthermi
protocoltocommunicatetothedefaultjstatdserverontheremotehost.Thejstatdserverislocatedusingthermiregistryonremote.domain
thatisboundtothedefaultrmiregistryport(port1099).
SEEALSO
javatheJavaApplicationLauncher
jpstheJavaProcessStatusApplication
jstatdthejvmstatdaemon
rmiregistrytheJavaRemoteObjectRegistry
Copyright1993,2014,Oracleand/oritsaffiliates.Allrightsreserved.
https://docs.oracle.com/javase/7/docs/technotes/tools/share/jstat.html
ContactUs
6/6