Gc log parameter migration in Java 9 and java9gclog migrationCollation
This article mainly studies the migration of gc log parameters in Java 9.
Unified JVM and GC Logging
Java program starts, query to the currently running Java process through the JPS observation process, using theJava code
Jinfo–flag USESERIALGC Process
The way you can locate the GC policy that it uses, because these parameters are Boolean constants, and if you use that kind of GC policy, the + sign will
JVM in the Java application optimization is an indispensable major, how to properly configure the Java parameters, if the validity of the validation configuration parameters, from the GC log can be very important hints, the following is the GC garbage collector by default on
GC log is a useful log of Java programs that best view issues when memory problems occur. Let's step through the GC log. First, the default Java program does not turn on
JAVA parsing heap Memory from GC log section SeventhIn the previous chapter, we only set the memory size of the entire heap. But we know that the heap is divided into the new generation, the old generation. How is the memory allocated between them? The new generation is also divided into Eden and survivor, can their proportions change? In fact, these are controll
:
Memory size specified by-XMS and-XMX options
Using the-server option
The system does not produce too many timeout logs
That is, if you do not set the memory size and your system generates too many timeout logs, congratulations you need to perform GC tuning for your system.However, keep in mind that GC tuning is a last resort option .Consider the underlying causes of
situations where memory usage is relatively fixed. However, if the service is heavily overloaded and occupies a large amount of memory, it is strongly recommended that GC optimizations be based on previous experience.I have set G1 GC parameters on some services and have performed performance tests. But there is no application to the formal environment, G1 GC par
attempt. Based on my experience in running Web servers in NHN, we recommend that you use the following JVM parameters to run Java programs. After monitoring the program performance under these parameters, you can select a more appropriate GC algorithm or configuration.
Table 3: Recommended JVM Parameters
Type
Parameters
Running Mode
-Sever
Total heap memory size
Set
heavily overloaded and occupies a large amount of memory, it is strongly recommended that GC optimizations be based on previous experience.I have set G1 GC parameters on some services and have performed performance tests. But there is no application to the formal environment, G1 GC parameters faster than any other GC
: Recommended JVM parameters
type
Parameters
Operating mode
-sever
Total Heap Memory size
Set the same values for-XMS and-XMX.
Cenozoic Space Size
-xx:newratio:2 to 4. -xx:newsize=? –xx:maxnewsize=?. It is also possible to use newsize instead of newratio.
Persistent generation space size
-xx:permsize=256m-xx:maxpermsize=256m. Set a value that does not have a problem in the run, and this
, the information about the CMS will be provided shortly thereafter.Because the -verbosegc option can output the information in log for each GC, it is easy to see how the heap usage changes after GC operations are turned off.(Java) VisualVM + Visual GCThe Java Virsual VM is
-sever
Total Heap Memory size
Set the same values for-XMS and-XMX.
Cenozoic Space Size
-xx:newratio:2 to 4. -xx:newsize=? –xx:maxnewsize=?. It is also possible to use newsize instead of newratio.
Persistent generation space size
-xx:permsize=256m-xx:maxpermsize=256m. Set a value that does not have a problem in the run, and this parameter does not affect performance.
GC
amount of heap space before GC occurs
Ending Occupancy3
Total heap Space Size after GC occurs
Pause Time3
Java application Pause duration when performing overall GC (including full GC)
The following is an example of a full
Enter setdomainenv.sh in the appropriate domain directoryJava_options= "Rear addSun JDK:${java_options}-verbosegc-xverboselog:/home/weblogic/bea/gc. ' Date +%y%m%d_%h%m%s 'IBM JDK${java_options}-verbosegc-xloggc:/home/weblogic/bea/gc. ' Date +%y%m%d_%h%m%s 'Therefore, the GC switch opensEach time showdown (including downtime), a
Garbage cat
Garbage collection log analyzer for openjdk and Sun JDK.
Https://code.google.com/a/eclipselabs.org/p/garbagecat/wiki/Documentation
Supports openjdk, Sun JDK 1.5, and higher
Command line tool
The report consists of three parts:
(1) bottlenecks, (2) summary, and (3) Unidentified log lines.
HP jmeterHttps://h20392.www2.hp.com/portal/swdepot/displayProdu
When the Java application starts, you can output the GC status of the JVM by setting the verbose parameter, which is the following command:-VERBOSE:GC or-XX:+PRINTGCIn eclipse, you can use the run as| Run configurations| arguments| The VM arguments is set.After using this command, the output is as follows:1[GC 3375k->1317k (15872K), 0.0047372secs]2[
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.