Java memory overflow and java Overflow

Source: Internet
Author: User

Java memory overflow and java Overflow

1. What memory overflow exceptions are there?

OutOfMemoryError:

When the data capacity reaches the maximum value for the heap, stack (multi-thread scenario), method zone (permanent zone), and local memory (metadata and Direct Memory ),

StackOverFlowError:

The stack depth requested by the thread is greater than the maximum depth allowed by the VM stack (1 MB by default ).

Ii. What are the causes and solutions for heap overflow?

Cause:

An OutOfMemory exception occurs when the number of objects in the heap reaches the maximum capacity.

Solution:

-XX: + HeapDumpOnOutOfMemoryError can cause memory overflow on the Java Virtual Machine,

Generate a snapshot of the current heap memory for exception analysis. This mainly analyzes which objects occupy the memory.

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.