JVM log sample analysis

Source: Internet
Author: User

Introduction: JVM analysis and optimization is a high level of content in the Java technical system. In fact, this is not so mysterious and profound, but most children's shoes have no chance to really contact them, so as to have a deep understanding of them. Here, we use a small question to show how to view the log information output by JVM and obtain the setting information of several JVM setting variables.


1. For the question, analyze the most likely JVM parameter settings.

Heap

Def New Generation total 6464 K, used 115 K [0x34e80000, 0x35580000, 0x35580000)

Eden space 5760 K, 2% used [0x34e80000, 0x34e9cd38, 0x35420000)

From space 704 K, 0% used [0x354d0000, 0x354d0000, 0x35580000)

To space 704 K, 0% used [0x35420000, 0x35420000, 0x354d0000)

Tenured generation total 18124 K, used 8277 K [0x3558133, 0x36733000, 0x37680000)

The space 18124 K, 45% used [0x35580000, 0x35d95758, 0x35d95800, 0x36733000)

Compacting perm Gen total 16384 K, used 16383 K [0x3768133, 0x38680000, 0x38680000)

The space 16384 K, 99% used [0x37680000, 0x3867ffc0, 0x38680000, 0x38680000)

RO space 10240 K, 44% used [0x38680000, 0x38af73f0, 0x38af7400, 0x39080000)

RW space 12288 K, 52% used [0x39080000, 0x0000cdd28, 0x0000cde00, 0x39c80000)

2. JVM Parameter Analysis

2.1-XX: + printgcdetails
The JVM needs to print detailed GC collection and memory distribution information, so you need to set this variable

2.2-xmx maximum heap space settings

Def New Generation indicates the new generation, and tenured generation indicates the old generation. Currently, the allocated space is 6 M. [0x34e80000, 0x35580000, 0x35580000): represents the minimum address, the currently allocated space address, and the maximum space address. The currently used space is 6 m + 18 m = 24 m.

Because x34e80000 ~~ The allocated space between 0x376800000 is 40 MB. Therefore, the current allocated space is not the set maximum space value. Therefore, we can see that it has set the maximum content space, in addition, the maximum space xmx and the minimum space XMS are not consistent.

Therefore, its-xmx40m cannot determine whether xmx has been set.

2.3-xmn young belt space settings

Analyze the information of Def new generation. The current memory usage is 6464 K, Eden space 5760 K, from/to space: 704 K. its maximum space address is the same as the current address space location: 0x35580000, but the current memory usage is not completely completed, so we can guess that it sets the memory size of the young band.

Its maximum space address is 0x35580000-the minimum space address 0x34e80000 = 7 M. Therefore, its-xmn is 7 m.

2.4 maxpermsize
Compacting perm Gen indicates permanent generation information, stores class information, static methods and variables, and constant information. Its maximum space address is the same as the current space address, so we can see that its memory has been fully allocated. In addition, we can see from the usage of 99% that the basic use is complete.

The maximum space address is 0x38680000-the minimum space address is 0x37680000 = 16.7 M. Therefore, the maximum permsize has been set, but the initial permsize cannot be known.

-XX: maxpermsize = 17 m.

3. Summary

The above text example is from the memory allocation segment in JVM. Through the above analysis, we can help you understand the current memory status information, so that you can use the above information, to optimize and tune the JVM.

JVM parameter:-xmx40m-xmn7m-XX: maxpermsize = 17 m-XX: + printgcdetails verbose: GC





JVM log sample analysis

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.