Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What does the JVM parameter table refer to

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

What does the JVM parameter table refer to? in view of this problem, this article introduces the corresponding analysis and solution in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible way.

The configurable parameter list of-XX: in Java HotSpot VM is described; these parameters can be loosely aggregated into three categories:

Behavior parameters (Behavioral Options): used to change some of the basic behaviors of jvm

Performance tuning (Performance Tuning): performance tuning for jvm

Debug parameters (Debugging Options): generally used to open trace, print, output and other jvm parameters, to display more detailed information of jvm

Behavior parameters:

Parameter and its default value description-XX:-DisableExplicitGC forbids calling System.gc (); but jvm's gc is still valid-XX:+MaxFDLimit maximizes the number of file descriptors-XX:+ScavengeBeforeFullGC new generation GC takes precedence over FullGC execution-XX:+UseGCOverheadLimit limits the proportion of time jvm spends on GC before throwing OOM-XX:-UseConcMarkSweepGC uses concurrent tag exchange algorithm for GC in the older generation Refers to the concurrent execution of GC by multiple threads, which is generally suitable for multiprocessor systems, which can improve the efficiency of GC, but the algorithm is complex and the system consumes a lot;-XX:-UseParallelGC enables parallel GC;, which means that when GC is running, it has no effect on the running of the application, and the threads of GC and app are executing concurrently, so that the running of app can be minimized. -XX:-UseParallelOldGC enables parallelism for Full GC, and automatically enables when-XX:-UseParallelGC is enabled-XX:-UseSerialGC enables the default GC mode of serial GC;jvm, which is generally suitable for small applications and single processors. The algorithm is relatively simple and GC efficiency is high, but it may bring pause to the application;-XX:+UseThreadPriorities enables local thread priority.

Performance tuning:

Parameter and its default value description-XX:LargePageSizeInBytes=4m sets large page size for Java heap-maximum percentage of free memory in java heap after XX:MaxHeapFreeRatio=70GC-maximum memory occupied by newly generated XX:MaxNewSize=size objects-maximum memory occupied by XX:MaxPermSize=64m older objects-minimum percentage of free memory in java heap after XX:MinHeapFreeRatio=40GC-ratio of XX:NewRatio=2 new generation memory capacity to old generation memory capacity-XX: Default value of memory occupied when NewSize=2.125m new generation objects are generated-XX:ReservedCodeCacheSize=32m preserves the amount of memory occupied by code-XX:ThreadStackSize=512 sets the thread stack size If 0, use the system default value-XX:+UseLargePages uses large page memory-objects with XX:PretenureSizeThreshold=10000 larger than the specified size, directly enter the old age-the age threshold for XX:MaxTenuringThreshold=15 promotion-XX:+HandlePromotionFailure=true off space allocation guarantee

Debug parameter list:

Parameter and its default value description-XX:-CITime print consumed in JIT compilation time-XX:ErrorFile=./hs_err_pid.log saves error log or data to file-XX:-ExtendedDTraceProbes turns on solaris-specific dtrace probe-XX:HeapDumpPath=./java_pid.hprof specifies the path or file name when exporting heap information-XX:-HeapDumpOnOutOfMemoryError exports relevant information in the heap when it encounters OOM for the first time-XX:OnError= " "run the custom command-XX:OnOutOfMemoryError= after the fatal ERROR occurs" "execute a custom command when you encounter OOM for the first time-XX:-PrintClassHistogram prints the column information of the class instance when it encounters Ctrl-Break, which has the same function as jmap-histo-XX:-PrintConcurrentLocks prints information about concurrent locks when it encounters Ctrl-Break. Same as jstack-l function-XX:-PrintCommandLineFlags prints tags that appear on the command line-XX:-PrintCompilation prints relevant information when a method is compiled-XX:-PrintGC prints relevant information every time GC-XX:-PrintGC Details prints details every time GC-XX:-PrintGCTimeStamps prints time stamp of each GC-loading information of XX:-TraceClassLoading tracking class-XX:-TraceClassLoadingPreorder tracks all classes referenced Load information-XX:-TraceClassResolution trace constant pool-unload information for XX:-TraceClassUnloading trace classes-information about XX:-TraceLoaderConstraints trace class loader constraints

When there is a problem with the system, you can't use external tracking tools (such as JProfiler... The above parameters can play an important role, such as dump heap information and printing concurrent locks.

G1:

Parameter and its default value description-XX: + UseG1GC enables G1GC. JDK7 and JDK8 requirements must show the request to launch the G1 GC. JDK9 has defaulted to G1-XX: the initial young generation of G1NewSizePercent accounts for the size of the entire Java Heap. The default value is 5%-XX: the largest young generation of G1MaxNewSizePercent accounts for the size of the entire Java Heap, and the default value is 60%-XX: G1HeapRegionSize sets the size of each Region, in MB, which needs to be one of 1, 2, 4, 4, and 16, and defaults to 1 Region 2000 of heap memory. -the number of GC threads that XX:ConcGCThreads executes with the Java application. The default is 1 Java 4 of the thread. Reducing the value of this parameter may improve the efficiency of parallel recycling, that is, increase the internal throughput of the system (the system is a whole, and everyone needs to take up CPU resources). However, if this value is too low, it will also cause the parallel recycling mechanism to take longer-the setting for starting parallel loops within XX:+InitiatingHeapOccupancyPercent (IHOP) G1 defaults to 45% of Java Heap. This can be understood as the space occupied by the old era, which needs to be less than 45% after GC collection. This value is mainly used to determine when to start the old parallel recycling cycle, which starts with initializing parallel recycling and avoids the occurrence of Full GC;-the memory size that XX:G1HeapWastePercentG1 will not reclaim is 5% of the heap size by default. GC collects all Region. If the value reaches 5%, it will stop collecting-XX:G1MixedGCCountTarget sets how many mixed GC starts are required after the parallel loop. The default value is 8. The collection time of the old Regions is usually longer than that of the younger generation, so if there are more mixed collectors, G1 can be allowed to extend the collection time of the old age. The parameter-XX:+G1PrintRegionLivenessInfo needs to be started in conjunction with-XX:+UnlockDiagnosticVMOptions, which is understandable. They are debugging information that belongs to VM. If enabled, VM prints the surviving object information for each Region in the heap memory. This information can be printed out at the end of the tag loop-the value of XX:G1ReservePercent is to reserve some space for inter-chronological ascension, and the default value is 10% of the heap space. Note that after this space is reserved, it will not be used for the younger generation. You can see that the output in the GC log shows that we are doing a lot of young generation recycling, so if you have more heap memory space and more large objects to survive in your application, you should reduce the reserved space a little bit. This will give the younger generation more reserved space and longer processing time between GC. -XX:+G1SummarizeRSetStats this is also a debug message for VM. If enabled, detailed summary information of VM will be printed when RSets is launched. If the-XX:G1SummaryRSetStatsPeriod parameter is enabled, the RSets information will be printed periodically;-XX:+G1TraceConcRefinement this is also the debugging information for a VM. If enabled, the logs of the parallel recycling phase will be printed in detail; some stages of XX:+GCTimeRatioGC require Stop-the-World, that is, to stop the application thread, which calculates the ratio of time spent on the Java application thread to the GC thread. The default is 9. The main purpose of this parameter is to allow users to control the time spent on the application. The formula of G1 is 100 / (1+GCTimeRatio), so that if 9 is adopted, up to 10% of the time will be spent on GC work. The default value of Parallel GC is 99, which means 1% of the time is spent on GC. This is because Parallel GC runs through the entire GC, while G1 is divided according to Region. There is no need for global scanning Java Heap;-XX:+UseStringDeduplication to manually turn on the segmentation of Java String objects. This is a new parameter after JDK8u20. It is mainly used for the same String to avoid repeated memory requests and save the use of Region. -A target value for XX:MaxGCPauseMillsG1 to stop execution (in milliseconds). The default is 200ms. This value may not really be reached. This parameter will achieve the goal by controlling the size of the younger generation. The answer to the question about what the JVM parameter table refers to is shared here. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel for more related knowledge.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report