In-depth understanding of Java Virtual Machine learning notes Chapter II Java memory area and memory overflow exception

Source: Internet
Author: User

2.2 Run-time area

A Java Virtual machine is divided into several different data regions,

1. Program counter, the bytecode interpreter is working by changing the value of the counter to take a scare jump. The bytecode command to execute

Understanding the String.intern () method

Function: If a string constant in the pool contains a string equal to this string object, the strings represented in the pool are returned, otherwise the string containing the object is added to the constant pool and a reference to this string object is returned.

Actual combat

Set the minimum-xms parameter of the heap to the same as the maximum-xmx parameter to prevent the heap from automatically expanding through the parameters-xx:+ Heapdumponoutofmemoryerror allows the virtual machine to dump the current memory heap dump snapshot for subsequent analysis when a memory overflow exception occurs

Java heap Memory Oom exceptions are common and occur when Java.lang.OutOfMemoryError:Java heap space is used to analyze memory overflows using Eclipse Memory analyzer

Recursive, easy to appear stackoverflowerror

Method area and run time zone test ideas: The runtime generates a large number of classes to fill the method area until overflow. CGLIB Create classes, generate Classcode to do, common with a large number of JSP or dynamically generated JSP file application

Eclipse Memory Analyzer uses

    1. The questions to understand later
      1. Understanding the String.intern () method
      2. Eclipse Memory Analyzer uses
      3. The relationship between the JDK and the virtual machine
      4. How to view GC logs

In-depth understanding of Java Virtual Machine learning notes Chapter II Java memory area and memory overflow exception

Related Article

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.