Newer
Older
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
.PP
Specifying this option disables automatic use of compressed oops if the
combined result of this and other options influencing the maximum amount
of memory is larger than the range of memory addressable by compressed
oops.
See \f[CB]\-XX:UseCompressedOops\f[R] for further information about
compressed oops.
.PP
Use the option \f[CB]\-XX:MaxRAMPercentage\f[R] instead.
.RE
.TP
.B \f[CB]\-XX:MinRAMFraction=\f[R]\f[I]ratio\f[R]
Sets the maximum amount of memory that the JVM may use for the Java heap
before applying ergonomics heuristics as a fraction of the maximum
amount determined as described in the \f[CB]\-XX:MaxRAM\f[R] option for
small heaps.
A small heap is a heap of approximately 125 MB.
The default value is 2.
.RS
.PP
Use the option \f[CB]\-XX:MinRAMPercentage\f[R] instead.
.RE
.TP
.B \f[CB]\-XX:+UseBiasedLocking\f[R]
Enables the use of biased locking.
Some applications with significant amounts of uncontended
synchronization may attain significant speedups with this flag enabled,
but applications with certain patterns of locking may see slowdowns.
.RS
.PP
By default, this option is disabled.
.RE
.SH OBSOLETE JAVA OPTIONS
.PP
These \f[CB]java\f[R] options are still accepted but ignored, and a
warning is issued when they\[aq]re used.
.TP
.B \f[CB]\-\-illegal\-access=\f[R]\f[I]parameter\f[R]
Controlled \f[I]relaxed strong encapsulation\f[R], as defined in \f[B]JEP
261\f[R]
[https://openjdk.java.net/jeps/261#Relaxed\-strong\-encapsulation].
This option was deprecated in JDK 16 by \f[B]JEP 396\f[R]
[https://openjdk.java.net/jeps/396] and made obsolete in JDK 17 by
\f[B]JEP 403\f[R] [https://openjdk.java.net/jeps/403].
.RS
.RE
.SH REMOVED JAVA OPTIONS
.PP
These \f[CB]java\f[R] options have been removed in JDK 17 and using them
results in an error of:
.RS
.PP
\f[CB]Unrecognized\ VM\ option\f[R] \f[I]option\-name\f[R]
.RE
.TP
.B \f[CB]\-XX:+UseMembar\f[R]
Enabled issuing membars on thread\-state transitions.
This option was disabled by default on all platforms except ARM servers,
where it was enabled.
.RS
.RE
.TP
.B \f[CB]\-XX:MaxPermSize=\f[R]\f[I]size\f[R]
Sets the maximum permanent generation space size (in bytes).
This option was deprecated in JDK 8 and superseded by the
\f[CB]\-XX:MaxMetaspaceSize\f[R] option.
.RS
.RE
.TP
.B \f[CB]\-XX:PermSize=\f[R]\f[I]size\f[R]
Sets the space (in bytes) allocated to the permanent generation that
triggers a garbage collection if it\[aq]s exceeded.
This option was deprecated in JDK 8 and superseded by the
\f[CB]\-XX:MetaspaceSize\f[R] option.
.RS
.RE
.TP
.B \f[CB]\-XX:+TraceClassLoading\f[R]
Enables tracing of classes as they are loaded.
By default, this option is disabled and classes aren\[aq]t traced.
.RS
.PP
The replacement Unified Logging syntax is
\f[CB]\-Xlog:class+load=\f[R]\f[I]level\f[R].
See \f[B]Enable Logging with the JVM Unified Logging Framework\f[R]
.PP
Use \f[I]level\f[R]=\f[CB]info\f[R] for regular information, or
\f[I]level\f[R]=\f[CB]debug\f[R] for additional information.
In Unified Logging syntax, \f[CB]\-verbose:class\f[R] equals
\f[CB]\-Xlog:class+load=info,class+unload=info\f[R].
.RE
.TP
.B \f[CB]\-XX:+TraceClassLoadingPreorder\f[R]
Enables tracing of all loaded classes in the order in which they\[aq]re
referenced.
By default, this option is disabled and classes aren\[aq]t traced.
.RS
.PP
The replacement Unified Logging syntax is
\f[CB]\-Xlog:class+preorder=debug\f[R].
See \f[B]Enable Logging with the JVM Unified Logging Framework\f[R].
.RE
.TP
.B \f[CB]\-XX:+TraceClassResolution\f[R]
Enables tracing of constant pool resolutions.
By default, this option is disabled and constant pool resolutions
aren\[aq]t traced.
.RS
.PP
The replacement Unified Logging syntax is
\f[CB]\-Xlog:class+resolve=debug\f[R].
See \f[B]Enable Logging with the JVM Unified Logging Framework\f[R].
.RE
.TP
.B \f[CB]\-XX:+TraceLoaderConstraints\f[R]
Enables tracing of the loader constraints recording.
By default, this option is disabled and loader constraints recording
isn\[aq]t traced.
.RS
.PP
The replacement Unified Logging syntax is
\f[CB]\-Xlog:class+loader+constraints=info\f[R].
See \f[B]Enable Logging with the JVM Unified Logging Framework\f[R].
.RE
.PP
For the lists and descriptions of options removed in previous releases
see the \f[I]Removed Java Options\f[R] section in:
.IP \[bu] 2
\f[B]Java Platform, Standard Edition Tools Reference, Release 16\f[R]
[https://docs.oracle.com/en/java/javase/16/docs/specs/man/java.html]
.IP \[bu] 2
\f[B]Java Platform, Standard Edition Tools Reference, Release 15\f[R]
[https://docs.oracle.com/en/java/javase/15/docs/specs/man/java.html]
.IP \[bu] 2
\f[B]Java Platform, Standard Edition Tools Reference, Release 14\f[R]
[https://docs.oracle.com/en/java/javase/14/docs/specs/man/java.html]
.IP \[bu] 2
\f[B]Java Platform, Standard Edition Tools Reference, Release 13\f[R]
[https://docs.oracle.com/en/java/javase/13/docs/specs/man/java.html]
.IP \[bu] 2
\f[B]Java Platform, Standard Edition Tools Reference, Release 12\f[R]
[https://docs.oracle.com/en/java/javase/12/tools/java.html#GUID\-3B1CE181\-CD30\-4178\-9602\-230B800D4FAE]
.IP \[bu] 2
\f[B]Java Platform, Standard Edition Tools Reference, Release 11\f[R]
[https://docs.oracle.com/en/java/javase/11/tools/java.html#GUID\-741FC470\-AA3E\-494A\-8D2B\-1B1FE4A990D1]
.IP \[bu] 2
\f[B]Java Platform, Standard Edition Tools Reference, Release 10\f[R]
[https://docs.oracle.com/javase/10/tools/java.htm#JSWOR624]
.IP \[bu] 2
\f[B]Java Platform, Standard Edition Tools Reference, Release 9\f[R]
[https://docs.oracle.com/javase/9/tools/java.htm#JSWOR624]
.IP \[bu] 2
\f[B]Java Platform, Standard Edition Tools Reference, Release 8 for
Oracle JDK on Windows\f[R]
[https://docs.oracle.com/javase/8/docs/technotes/tools/windows/java.html#BGBCIEFC]
.IP \[bu] 2
\f[B]Java Platform, Standard Edition Tools Reference, Release 8 for
Oracle JDK on Solaris, Linux, and macOS\f[R]
[https://docs.oracle.com/javase/8/docs/technotes/tools/unix/java.html#BGBCIEFC]
.SH JAVA COMMAND\-LINE ARGUMENT FILES
.PP
You can shorten or simplify the \f[CB]java\f[R] command by using
\f[CB]\@\f[R] argument files to specify one or more text files that
contain arguments, such as options and class names, which are passed to
the \f[CB]java\f[R] command.
This let\[aq]s you to create \f[CB]java\f[R] commands of any length on any
operating system.
.PP
In the command line, use the at sign (\f[CB]\@\f[R]) prefix to identify an
argument file that contains \f[CB]java\f[R] options and class names.
When the \f[CB]java\f[R] command encounters a file beginning with the at
sign (\f[CB]\@\f[R]), it expands the contents of that file into an
argument list just as they would be specified on the command line.
.PP
The \f[CB]java\f[R] launcher expands the argument file contents until it
encounters the \f[CB]\-\-disable\-\@files\f[R] option.
You can use the \f[CB]\-\-disable\-\@files\f[R] option anywhere on the
command line, including in an argument file, to stop \f[CB]\@\f[R]
argument files expansion.
.PP
The following items describe the syntax of \f[CB]java\f[R] argument files:
.IP \[bu] 2
The argument file must contain only ASCII characters or characters in
system default encoding that\[aq]s ASCII friendly, such as UTF\-8.
.IP \[bu] 2
The argument file size must not exceed MAXINT (2,147,483,647) bytes.
.IP \[bu] 2
The launcher doesn\[aq]t expand wildcards that are present within an
argument file.
.IP \[bu] 2
Use white space or new line characters to separate arguments included in
the file.
.IP \[bu] 2
White space includes a white space character, \f[CB]\\t\f[R],
\f[CB]\\n\f[R], \f[CB]\\r\f[R], and \f[CB]\\f\f[R].
.RS 2
.PP
For example, it is possible to have a path with a space, such as
\f[CB]c:\\Program\ Files\f[R] that can be specified as either
\f[CB]"c:\\\\Program\ Files"\f[R] or, to avoid an escape,
\f[CB]c:\\Program"\ "Files\f[R].
.RE
.IP \[bu] 2
Any option that contains spaces, such as a path component, must be
within quotation marks using quotation (\[aq]"\[aq]) characters in its
entirety.
.IP \[bu] 2
A string within quotation marks may contain the characters \f[CB]\\n\f[R],
\f[CB]\\r\f[R], \f[CB]\\t\f[R], and \f[CB]\\f\f[R].
They are converted to their respective ASCII codes.
.IP \[bu] 2
If a file name contains embedded spaces, then put the whole file name in
double quotation marks.
.IP \[bu] 2
File names in an argument file are relative to the current directory,
not to the location of the argument file.
.IP \[bu] 2
Use the number sign \f[CB]#\f[R] in the argument file to identify
comments.
All characters following the \f[CB]#\f[R] are ignored until the end of
line.
.IP \[bu] 2
Additional at sign \f[CB]\@\f[R] prefixes to \f[CB]\@\f[R] prefixed options
act as an escape, (the first \f[CB]\@\f[R] is removed and the rest of the
arguments are presented to the launcher literally).
.IP \[bu] 2
Lines may be continued using the continuation character (\f[CB]\\\f[R]) at
the end\-of\-line.
The two lines are concatenated with the leading white spaces trimmed.
To prevent trimming the leading white spaces, a continuation character
(\f[CB]\\\f[R]) may be placed at the first column.
.IP \[bu] 2
Because backslash (\\) is an escape character, a backslash character
must be escaped with another backslash character.
.IP \[bu] 2
Partial quote is allowed and is closed by an end\-of\-file.
.IP \[bu] 2
An open quote stops at end\-of\-line unless \f[CB]\\\f[R] is the last
character, which then joins the next line by removing all leading white
space characters.
.IP \[bu] 2
Wildcards (*) aren\[aq]t allowed in these lists (such as specifying
\f[CB]*.java\f[R]).
.IP \[bu] 2
Use of the at sign (\f[CB]\@\f[R]) to recursively interpret files
isn\[aq]t supported.
.SS Example of Open or Partial Quotes in an Argument File
.PP
In the argument file,
.IP
.nf
\f[CB]
\-cp\ "lib/
cool/
app/
jars
\f[R]
.fi
.PP
this is interpreted as:
.RS
.PP
\f[CB]\-cp\ lib/cool/app/jars\f[R]
.RE
.SS Example of a Backslash Character Escaped with Another Backslash
Character in an Argument File
.PP
To output the following:
.RS
.PP
\f[CB]\-cp\ c:\\Program\ Files\ (x86)\\Java\\jre\\lib\\ext;c:\\Program\ Files\\Java\\jre9\\lib\\ext\f[R]
.RE
.PP
The backslash character must be specified in the argument file as:
.RS
.PP
\f[CB]\-cp\ "c:\\\\Program\ Files\ (x86)\\\\Java\\\\jre\\\\lib\\\\ext;c:\\\\Program\ Files\\\\Java\\\\jre9\\\\lib\\\\ext"\f[R]
.RE
.SS Example of an EOL Escape Used to Force Concatenation of Lines in an
Argument File
.PP
In the argument file,
.IP
.nf
\f[CB]
\-cp\ "/lib/cool\ app/jars:\\
\ \ \ \ /lib/another\ app/jars"
\f[R]
.fi
.PP
This is interpreted as:
.RS
.PP
\f[CB]\-cp\ /lib/cool\ app/jars:/lib/another\ app/jars\f[R]
.RE
.SS Example of Line Continuation with Leading Spaces in an Argument File
.PP
In the argument file,
.IP
.nf
\f[CB]
\-cp\ "/lib/cool\\
\\app/jars???
\f[R]
.fi
.PP
This is interpreted as:
.PP
\f[CB]\-cp\ /lib/cool\ app/jars\f[R]
.SS Examples of Using Single Argument File
.PP
You can use a single argument file, such as \f[CB]myargumentfile\f[R] in
the following example, to hold all required \f[CB]java\f[R] arguments:
.RS
.PP
\f[CB]java\ \@myargumentfile\f[R]
.RE
.SS Examples of Using Argument Files with Paths
.PP
You can include relative paths in argument files; however, they\[aq]re
relative to the current working directory and not to the paths of the
argument files themselves.
In the following example, \f[CB]path1/options\f[R] and
\f[CB]path2/options\f[R] represent argument files with different paths.
Any relative paths that they contain are relative to the current working
directory and not to the argument files:
.RS
.PP
\f[CB]java\ \@path1/options\ \@path2/classes\f[R]
.RE
.SH CODE HEAP STATE ANALYTICS
.SS Overview
.PP
There are occasions when having insight into the current state of the
JVM code heap would be helpful to answer questions such as:
.IP \[bu] 2
Why was the JIT turned off and then on again and again?
.IP \[bu] 2
Where has all the code heap space gone?
.IP \[bu] 2
Why is the method sweeper not working effectively?
.PP
To provide this insight, a code heap state analytics feature has been
implemented that enables on\-the\-fly analysis of the code heap.
The analytics process is divided into two parts.
The first part examines the entire code heap and aggregates all
information that is believed to be useful or important.
The second part consists of several independent steps that print the
collected information with an emphasis on different aspects of the data.
Data collection and printing are done on an "on request" basis.
.SS Syntax
.PP
Requests for real\-time, on\-the\-fly analysis can be issued with the
following command:
.RS
.PP
\f[CB]jcmd\f[R] \f[I]pid\f[R] \f[CB]Compiler.CodeHeap_Analytics\f[R]
[\f[I]function\f[R]] [\f[I]granularity\f[R]]
.RE
.PP
If you are only interested in how the code heap looks like after running
a sample workload, you can use the command line option:
.RS
.PP
\f[CB]\-Xlog:codecache=Trace\f[R]
.RE
.PP
To see the code heap state when a "CodeCache full" condition exists,
start the VM with the command line option:
.RS
.PP
\f[CB]\-Xlog:codecache=Debug\f[R]
.RE
.PP
See \f[B]CodeHeap State Analytics (OpenJDK)\f[R]
[https://bugs.openjdk.java.net/secure/attachment/75649/JVM_CodeHeap_StateAnalytics_V2.pdf]
for a detailed description of the code heap state analytics feature, the
supported functions, and the granularity options.
.SH ENABLE LOGGING WITH THE JVM UNIFIED LOGGING FRAMEWORK
.PP
You use the \f[CB]\-Xlog\f[R] option to configure or enable logging with
the Java Virtual Machine (JVM) unified logging framework.
.SS Synopsis
.RS
.PP
\f[CB]\-Xlog\f[R][\f[CB]:\f[R][\f[I]what\f[R]][\f[CB]:\f[R][\f[I]output\f[R]][\f[CB]:\f[R][\f[I]decorators\f[R]][\f[CB]:\f[R]\f[I]output\-options\f[R][\f[CB],\f[R]...]]]]]
.PP
\f[CB]\-Xlog:\f[R]\f[I]directive\f[R]
.RE
.TP
.B \f[I]what\f[R]
Specifies a combination of tags and levels of the form
\f[I]tag1\f[R][\f[CB]+\f[R]\f[I]tag2\f[R]...][\f[CB]*\f[R]][\f[CB]=\f[R]\f[I]level\f[R]][\f[CB],\f[R]...].
Unless the wildcard (\f[CB]*\f[R]) is specified, only log messages tagged
with exactly the tags specified are matched.
See \f[B]\-Xlog Tags and Levels\f[R].
.RS
.RE
.TP
.B \f[I]output\f[R]
Sets the type of output.
Omitting the \f[I]output\f[R] type defaults to \f[CB]stdout\f[R].
See \f[B]\-Xlog Output\f[R].
.RS
.RE
.TP
.B \f[I]decorators\f[R]
Configures the output to use a custom set of decorators.
Omitting \f[I]decorators\f[R] defaults to \f[CB]uptime\f[R],
\f[CB]level\f[R], and \f[CB]tags\f[R].
See \f[B]Decorations\f[R].
.RS
.RE
.TP
.B \f[I]output\-options\f[R]
Sets the \f[CB]\-Xlog\f[R] logging output options.
.RS
.RE
.TP
.B \f[I]directive\f[R]
A global option or subcommand: help, disable, async
.RS
.RE
.SS Description
.PP
The Java Virtual Machine (JVM) unified logging framework provides a
common logging system for all components of the JVM.
GC logging for the JVM has been changed to use the new logging
framework.
The mapping of old GC flags to the corresponding new Xlog configuration
is described in \f[B]Convert GC Logging Flags to Xlog\f[R].
In addition, runtime logging has also been changed to use the JVM
unified logging framework.
The mapping of legacy runtime logging flags to the corresponding new
Xlog configuration is described in \f[B]Convert Runtime Logging Flags to
Xlog\f[R].
.PP
The following provides quick reference to the \f[CB]\-Xlog\f[R] command
and syntax for options:
.TP
.B \f[CB]\-Xlog\f[R]
Enables JVM logging on an \f[CB]info\f[R] level.
.RS
.RE
.TP
.B \f[CB]\-Xlog:help\f[R]
Prints \f[CB]\-Xlog\f[R] usage syntax and available tags, levels, and
decorators along with example command lines with explanations.
.RS
.RE
.TP
.B \f[CB]\-Xlog:disable\f[R]
Turns off all logging and clears all configuration of the logging
framework including the default configuration for warnings and errors.
.RS
.RE
.TP
.B \f[CB]\-Xlog\f[R][\f[CB]:\f[R]\f[I]option\f[R]]
Applies multiple arguments in the order that they appear on the command
line.
Multiple \f[CB]\-Xlog\f[R] arguments for the same output override each
other in their given order.
.RS
.PP
The \f[I]option\f[R] is set as:
.RS
.PP
[\f[I]tag\-selection\f[R]][\f[CB]:\f[R][\f[I]output\f[R]][\f[CB]:\f[R][\f[I]decorators\f[R]][\f[CB]:\f[R]\f[I]output\-options\f[R]]]]
.RE
.PP
Omitting the \f[I]tag\-selection\f[R] defaults to a tag\-set of
\f[CB]all\f[R] and a level of \f[CB]info\f[R].
.RS
.PP
\f[I]tag\f[R][\f[CB]+\f[R]...] \f[CB]all\f[R]
.RE
.PP
The \f[CB]all\f[R] tag is a meta tag consisting of all tag\-sets
available.
The asterisk \f[CB]*\f[R] in a tag set definition denotes a wildcard tag
match.
Matching with a wildcard selects all tag sets that contain \f[I]at
least\f[R] the specified tags.
Without the wildcard, only exact matches of the specified tag sets are
selected.
.PP
\f[I]output\-options\f[R] is
.RS
.PP
\f[CB]filecount=\f[R]\f[I]file\-count\f[R] \f[CB]filesize=\f[R]\f[I]file size
with optional K, M or G suffix\f[R]
.RE
.RE
.SS Default Configuration
.PP
When the \f[CB]\-Xlog\f[R] option and nothing else is specified on the
command line, the default configuration is used.
The default configuration logs all messages with a level that matches
either warning or error regardless of what tags the message is
associated with.
The default configuration is equivalent to entering the following on the
command line:
.RS
.PP
\f[CB]\-Xlog:all=warning:stdout:uptime,level,tags\f[R]
.RE
.SS Controlling Logging at Runtime
.PP
Logging can also be controlled at run time through Diagnostic Commands
(with the \f[B]jcmd\f[R] utility).
Everything that can be specified on the command line can also be
specified dynamically with the \f[CB]VM.log\f[R] command.
As the diagnostic commands are automatically exposed as MBeans, you can
use JMX to change logging configuration at run time.
.SS \-Xlog Tags and Levels
.PP
Each log message has a level and a tag set associated with it.
The level of the message corresponds to its details, and the tag set
corresponds to what the message contains or which JVM component it
involves (such as, \f[CB]gc\f[R], \f[CB]jit\f[R], or \f[CB]os\f[R]).
Mapping GC flags to the Xlog configuration is described in \f[B]Convert
GC Logging Flags to Xlog\f[R].
Mapping legacy runtime logging flags to the corresponding Xlog
configuration is described in \f[B]Convert Runtime Logging Flags to
Xlog\f[R].
.PP
\f[B]Available log levels:\f[R]
.IP \[bu] 2
\f[CB]off\f[R]
.IP \[bu] 2
\f[CB]trace\f[R]
.IP \[bu] 2
\f[CB]debug\f[R]
.IP \[bu] 2
\f[CB]info\f[R]
.IP \[bu] 2
\f[CB]warning\f[R]
.IP \[bu] 2
\f[CB]error\f[R]
.PP
\f[B]Available log tags:\f[R]
.PP
There are literally dozens of log tags, which in the right combinations,
will enable a range of logging output.
The full set of available log tags can be seen using
\f[CB]\-Xlog:help\f[R].
Specifying \f[CB]all\f[R] instead of a tag combination matches all tag
combinations.
.SS \-Xlog Output
.PP
The \f[CB]\-Xlog\f[R] option supports the following types of outputs:
.IP \[bu] 2
\f[CB]stdout\f[R] \-\-\- Sends output to stdout
.IP \[bu] 2
\f[CB]stderr\f[R] \-\-\- Sends output to stderr
.IP \[bu] 2
\f[CB]file=\f[R]\f[I]filename\f[R] \-\-\- Sends output to text file(s).
.PP
When using \f[CB]file=\f[R]\f[I]filename\f[R], specifying \f[CB]%p\f[R]
and/or \f[CB]%t\f[R] in the file name expands to the JVM\[aq]s PID and
startup timestamp, respectively.
You can also configure text files to handle file rotation based on file
size and a number of files to rotate.
For example, to rotate the log file every 10 MB and keep 5 files in
rotation, specify the options \f[CB]filesize=10M,\ filecount=5\f[R].
The target size of the files isn\[aq]t guaranteed to be exact, it\[aq]s
just an approximate value.
Files are rotated by default with up to 5 rotated files of target size
20 MB, unless configured otherwise.
Specifying \f[CB]filecount=0\f[R] means that the log file shouldn\[aq]t be
rotated.
There\[aq]s a possibility of the pre\-existing log file getting
overwritten.
.SS \-Xlog Output Mode
.PP
By default logging messages are output synchronously \- each log message
is written to the designated output when the logging call is made.
But you can instead use asynchronous logging mode by specifying:
.TP
.B \f[CB]\-Xlog:async\f[R]
Write all logging asynchronously.
.RS
.RE
.PP
In asynchronous logging mode, log sites enqueue all logging messages to
an intermediate buffer and a standalone thread is responsible for
flushing them to the corresponding outputs.
The intermediate buffer is bounded and on buffer exhaustion the
enqueuing message is discarded.
Log entry write operations are guaranteed non\-blocking.
.PP
The option \f[CB]\-XX:AsyncLogBufferSize=N\f[R] specifies the memory
budget in bytes for the intermediate buffer.
The default value should be big enough to cater for most cases.
Users can provide a custom value to trade memory overhead for log
accuracy if they need to.
.SS Decorations
.PP
Logging messages are decorated with information about the message.
You can configure each output to use a custom set of decorators.
The order of the output is always the same as listed in the table.
You can configure the decorations to be used at run time.
Decorations are prepended to the log message.
For example:
.IP
.nf
\f[CB]
[6.567s][info][gc,old]\ Old\ collection\ complete
\f[R]
.fi
.PP
Omitting \f[CB]decorators\f[R] defaults to \f[CB]uptime\f[R],
\f[CB]level\f[R], and \f[CB]tags\f[R].
The \f[CB]none\f[R] decorator is special and is used to turn off all
decorations.
.PP
\f[CB]time\f[R] (\f[CB]t\f[R]), \f[CB]utctime\f[R] (\f[CB]utc\f[R]),
\f[CB]uptime\f[R] (\f[CB]u\f[R]), \f[CB]timemillis\f[R] (\f[CB]tm\f[R]),
\f[CB]uptimemillis\f[R] (\f[CB]um\f[R]), \f[CB]timenanos\f[R] (\f[CB]tn\f[R]),
\f[CB]uptimenanos\f[R] (\f[CB]un\f[R]), \f[CB]hostname\f[R] (\f[CB]hn\f[R]),
\f[CB]pid\f[R] (\f[CB]p\f[R]), \f[CB]tid\f[R] (\f[CB]ti\f[R]), \f[CB]level\f[R]
(\f[CB]l\f[R]), \f[CB]tags\f[R] (\f[CB]tg\f[R]) decorators can also be
specified as \f[CB]none\f[R] for no decoration.
.PP
.TS
tab(@);
lw(14.9n) lw(55.1n).
T{
Decorations
T}@T{
Description
T}
_
T{
\f[CB]time\f[R] or \f[CB]t\f[R]
T}@T{
Current time and date in ISO\-8601 format.
T}
T{
\f[CB]utctime\f[R] or \f[CB]utc\f[R]
T}@T{
Universal Time Coordinated or Coordinated Universal Time.
T}
T{
\f[CB]uptime\f[R] or \f[CB]u\f[R]
T}@T{
Time since the start of the JVM in seconds and milliseconds.
For example, 6.567s.
T}
T{
\f[CB]timemillis\f[R] or \f[CB]tm\f[R]
T}@T{
The same value as generated by \f[CB]System.currentTimeMillis()\f[R]
T}
T{
\f[CB]uptimemillis\f[R] or \f[CB]um\f[R]
T}@T{
Milliseconds since the JVM started.
T}
T{
\f[CB]timenanos\f[R] or \f[CB]tn\f[R]
T}@T{
The same value generated by \f[CB]System.nanoTime()\f[R].
T}
T{
\f[CB]uptimenanos\f[R] or \f[CB]un\f[R]
T}@T{
Nanoseconds since the JVM started.
T}
T{
\f[CB]hostname\f[R] or \f[CB]hn\f[R]
T}@T{
The host name.
T}
T{
\f[CB]pid\f[R] or \f[CB]p\f[R]
T}@T{
The process identifier.
T}
T{
\f[CB]tid\f[R] or \f[CB]ti\f[R]
T}@T{
The thread identifier.
T}
T{
\f[CB]level\f[R] or \f[CB]l\f[R]
T}@T{
The level associated with the log message.
T}
T{
\f[CB]tags\f[R] or \f[CB]tg\f[R]
T}@T{
The tag\-set associated with the log message.
T}
.TE
.SS Convert GC Logging Flags to Xlog
.PP
.TS
tab(@);
lw(22.4n) lw(16.5n) lw(31.2n).
T{
Legacy Garbage Collection (GC) Flag
T}@T{
Xlog Configuration
T}@T{
Comment
T}
_
T{
\f[CB]G1PrintHeapRegions\f[R]
T}@T{
\f[CB]\-Xlog:gc+region=trace\f[R]
T}@T{
Not Applicable
T}
T{
\f[CB]GCLogFileSize\f[R]
T}@T{
No configuration available
T}@T{
Log rotation is handled by the framework.
T}
T{
\f[CB]NumberOfGCLogFiles\f[R]
T}@T{
Not Applicable
T}@T{
Log rotation is handled by the framework.
T}
T{
\f[CB]PrintAdaptiveSizePolicy\f[R]
T}@T{
\f[CB]\-Xlog:gc+ergo*=\f[R]\f[I]level\f[R]
T}@T{
Use a \f[I]level\f[R] of \f[CB]debug\f[R] for most of the information, or a
\f[I]level\f[R] of \f[CB]trace\f[R] for all of what was logged for
\f[CB]PrintAdaptiveSizePolicy\f[R].
T}
T{
\f[CB]PrintGC\f[R]
T}@T{
\f[CB]\-Xlog:gc\f[R]
T}@T{
Not Applicable
T}
T{
\f[CB]PrintGCApplicationConcurrentTime\f[R]
T}@T{
\f[CB]\-Xlog:safepoint\f[R]
T}@T{
Note that \f[CB]PrintGCApplicationConcurrentTime\f[R] and
\f[CB]PrintGCApplicationStoppedTime\f[R] are logged on the same tag and
aren\[aq]t separated in the new logging.
T}
T{
\f[CB]PrintGCApplicationStoppedTime\f[R]
T}@T{
\f[CB]\-Xlog:safepoint\f[R]
T}@T{
Note that \f[CB]PrintGCApplicationConcurrentTime\f[R] and
\f[CB]PrintGCApplicationStoppedTime\f[R] are logged on the same tag and
not separated in the new logging.
T}
T{
\f[CB]PrintGCCause\f[R]
T}@T{
Not Applicable
T}@T{
GC cause is now always logged.
T}
T{
\f[CB]PrintGCDateStamps\f[R]
T}@T{
Not Applicable
T}@T{
Date stamps are logged by the framework.
T}
T{
\f[CB]PrintGCDetails\f[R]
T}@T{
\f[CB]\-Xlog:gc*\f[R]
T}@T{
Not Applicable
T}
T{
\f[CB]PrintGCID\f[R]
T}@T{
Not Applicable
T}@T{
GC ID is now always logged.
T}
T{
\f[CB]PrintGCTaskTimeStamps\f[R]
T}@T{
\f[CB]\-Xlog:gc+task*=debug\f[R]
T}@T{
Not Applicable
T}
T{
\f[CB]PrintGCTimeStamps\f[R]
T}@T{
Not Applicable
T}@T{
Time stamps are logged by the framework.
T}
T{
\f[CB]PrintHeapAtGC\f[R]
T}@T{
\f[CB]\-Xlog:gc+heap=trace\f[R]
T}@T{
Not Applicable
T}
T{
\f[CB]PrintReferenceGC\f[R]
T}@T{
\f[CB]\-Xlog:gc+ref*=debug\f[R]
T}@T{
Note that in the old logging, \f[CB]PrintReferenceGC\f[R] had an effect
only if \f[CB]PrintGCDetails\f[R] was also enabled.
T}
T{
\f[CB]PrintStringDeduplicationStatistics\f[R]
T}@T{
`\-Xlog:gc+stringdedup*=debug
T}@T{
` Not Applicable
T}
T{
\f[CB]PrintTenuringDistribution\f[R]
T}@T{
\f[CB]\-Xlog:gc+age*=\f[R]\f[I]level\f[R]
T}@T{
Use a \f[I]level\f[R] of \f[CB]debug\f[R] for the most relevant
information, or a \f[I]level\f[R] of \f[CB]trace\f[R] for all of what was
logged for \f[CB]PrintTenuringDistribution\f[R].
T}
T{
\f[CB]UseGCLogFileRotation\f[R]
T}@T{
Not Applicable
T}@T{
What was logged for \f[CB]PrintTenuringDistribution\f[R].
T}
.TE
.SS Convert Runtime Logging Flags to Xlog
.PP
These legacy flags are no longer recognized and will cause an error if
used directly.
Use their unified logging equivalent instead.
.PP
.TS
tab(@);
lw(15.0n) lw(20.2n) lw(34.7n).
T{
Legacy Runtime Flag
T}@T{
Xlog Configuration
T}@T{
Comment
T}
_
T{
\f[CB]TraceExceptions\f[R]
T}@T{
\f[CB]\-Xlog:exceptions=info\f[R]
T}@T{
Not Applicable
T}
T{
\f[CB]TraceClassLoading\f[R]
T}@T{
\f[CB]\-Xlog:class+load=\f[R]\f[I]level\f[R]
T}@T{
Use \f[I]level\f[R]=\f[CB]info\f[R] for regular information, or
\f[I]level\f[R]=\f[CB]debug\f[R] for additional information.
In Unified Logging syntax, \f[CB]\-verbose:class\f[R] equals
\f[CB]\-Xlog:class+load=info,class+unload=info\f[R].
T}
T{
\f[CB]TraceClassLoadingPreorder\f[R]
T}@T{
\f[CB]\-Xlog:class+preorder=debug\f[R]
T}@T{
Not Applicable
T}
T{
\f[CB]TraceClassUnloading\f[R]
T}@T{
\f[CB]\-Xlog:class+unload=\f[R]\f[I]level\f[R]
T}@T{
Use \f[I]level\f[R]=\f[CB]info\f[R] for regular information, or
\f[I]level\f[R]=\f[CB]trace\f[R] for additional information.
In Unified Logging syntax, \f[CB]\-verbose:class\f[R] equals
\f[CB]\-Xlog:class+load=info,class+unload=info\f[R].
T}
T{
\f[CB]VerboseVerification\f[R]
T}@T{
\f[CB]\-Xlog:verification=info\f[R]
T}@T{
Not Applicable
T}
T{
\f[CB]TraceClassPaths\f[R]
T}@T{
\f[CB]\-Xlog:class+path=info\f[R]
T}@T{
Not Applicable
T}
T{
\f[CB]TraceClassResolution\f[R]
T}@T{
\f[CB]\-Xlog:class+resolve=debug\f[R]
T}@T{
Not Applicable
T}
T{
\f[CB]TraceClassInitialization\f[R]
T}@T{
\f[CB]\-Xlog:class+init=info\f[R]
T}@T{
Not Applicable
T}
T{
\f[CB]TraceLoaderConstraints\f[R]
T}@T{
\f[CB]\-Xlog:class+loader+constraints=info\f[R]
T}@T{
Not Applicable
T}
T{
\f[CB]TraceClassLoaderData\f[R]
T}@T{
\f[CB]\-Xlog:class+loader+data=\f[R]\f[I]level\f[R]
T}@T{
Use \f[I]level\f[R]=\f[CB]debug\f[R] for regular information or
\f[I]level\f[R]=\f[CB]trace\f[R] for additional information.
T}
T{
\f[CB]TraceSafepointCleanupTime\f[R]
T}@T{
\f[CB]\-Xlog:safepoint+cleanup=info\f[R]
T}@T{
Not Applicable
T}
T{
\f[CB]TraceSafepoint\f[R]
T}@T{
\f[CB]\-Xlog:safepoint=debug\f[R]
T}@T{
Not Applicable
T}
T{
\f[CB]TraceMonitorInflation\f[R]
T}@T{
\f[CB]\-Xlog:monitorinflation=debug\f[R]
T}@T{
Not Applicable
T}
T{
\f[CB]TraceBiasedLocking\f[R]
T}@T{
\f[CB]\-Xlog:biasedlocking=\f[R]\f[I]level\f[R]
T}@T{
Use \f[I]level\f[R]=\f[CB]info\f[R] for regular information, or
\f[I]level\f[R]=\f[CB]trace\f[R] for additional information.
T}
T{
\f[CB]TraceRedefineClasses\f[R]
T}@T{
\f[CB]\-Xlog:redefine+class*=\f[R]\f[I]level\f[R]
T}@T{
\f[I]level\f[R]=\f[CB]info\f[R], \f[CB]debug\f[R], and \f[CB]trace\f[R] provide
increasing amounts of information.
T}
.TE
.SS \-Xlog Usage Examples
.PP
The following are \f[CB]\-Xlog\f[R] examples.
.TP
.B \f[CB]\-Xlog\f[R]
Logs all messages by using the \f[CB]info\f[R] level to \f[CB]stdout\f[R]
with \f[CB]uptime\f[R], \f[CB]levels\f[R], and \f[CB]tags\f[R] decorations.
This is equivalent to using:
.RS
.RS
.PP
\f[CB]\-Xlog:all=info:stdout:uptime,levels,tags\f[R]
.RE
.RE
.TP
.B \f[CB]\-Xlog:gc\f[R]
Logs messages tagged with the \f[CB]gc\f[R] tag using \f[CB]info\f[R] level
to \f[CB]stdout\f[R].
The default configuration for all other messages at level
\f[CB]warning\f[R] is in effect.
.RS
.RE
.TP
.B \f[CB]\-Xlog:gc,safepoint\f[R]