Skip to Content
Java Performance, 2nd Edition
book

Java Performance, 2nd Edition

by Scott Oaks
February 2020
Intermediate to advanced
448 pages
13h 15m
English
O'Reilly Media, Inc.
Book available
Content preview from Java Performance, 2nd Edition

Appendix. Summary of Tuning Flags

This appendix covers commonly used flags and gives pointers on when to use them. Commonly used here includes flags that were commonly used in previous versions of Java and are no longer recommended; documentation and tips on older versions of Java may recommend those flags, so they are mentioned here.

Table A-1. Flags to tune the just-in-time compiler
Flag What it does When to use it See also

-server

This flag no longer has any effect; it is silently ignored.

N/A

“Tiered Compilation”

-client

This flag no longer has any effect; it is silently ignored.

N/A

“Tiered Compilation”

-XX:+TieredCompilation

Uses tiered compilation.

Always, unless you are severely constrained for memory.

“Tiered Compilation” and “Tiered Compilation Trade-offs”

-XX:ReservedCodeCacheSize=<MB>

Reserves space for code compiled by the JIT compiler.

When running a large program and you see a warning that you are out of code cache.

“Tuning the Code Cache”

-XX:InitialCodeCacheSize=<MB>

Allocates the initial space for code compiled by the JIT compiler.

If you need to preallocate the memory for the code cache (which is uncommon).

“Tuning the Code Cache”

-XX:CompileThreshold=<N>

Sets the number of times a method or loop is executed before compiling it.

This flag is no longer recommended.

“Compilation Thresholds”

-XX:+PrintCompilation

Provides a log of operations by the JIT compiler.

When you suspect an important method isn’t being compiled or are generally curious ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

The Well-Grounded Java Developer, Second Edition

The Well-Grounded Java Developer, Second Edition

Benjamin Evans, Martijn Verburg, Jason Clark
Java in a Nutshell, 7th Edition

Java in a Nutshell, 7th Edition

Benjamin J. Evans, David Flanagan
Java in a Nutshell, 8th Edition

Java in a Nutshell, 8th Edition

Benjamin J. Evans, Jason Clark, David Flanagan

Publisher Resources

ISBN: 9781492056102Errata PageSupplemental Content