A diagnosis of 2014-5-22 Java.lang.OutOfMemoryError:Java heap space

Source: Internet
Author: User

Received message a system with a node due to memory overflow and downtime, the system middleware is WebLogic, the database of Oracle.

1. First Use IBM heapanalyzer to analyze the dump file at memory overflow, find the most memory-intensive request, and look at the code.

2. In the follow-up code found that the methods in this class are particularly simple, the single table of the additions and deletions, there is a query is very easy, there will be no operation of big data, so that the database is excluded from the problem.

3. Continue to look at this class, found that in this class when the initialization of the creation of 16 classes, the 16 classes created another class, the memory overflow that this is what it produced, need to prove.

4. Connect WebLogic with Jconsole, find a corresponding function, continuous press save button10 times, found that memory up more than 300 m, OK is this problem, in the case of concurrency will be problematic.

5. Improvement method: The principle of less work, remove the unused calls, and then put some classes in the method to reduce its scope.

This event reminds me of why there is not a lot of class storage, there are many calls nested, the convenience of writing code and performance must have a balance.

A diagnosis of 2014-5-22 Java.lang.OutOfMemoryError:Java heap space

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.