JBoss Memory Overflow Processing

Source: Internet
Author: User

JBoss Memory Overflow Processinga few days ago the company a Project Server broken, changed a backup server to replace, but did not run for a while down, has been reported java.lang.OutOfMemoryError .... See here, it is memory overflow, but JBoss memory configuration has reached 1024M, and the results of the monitoring of the JBoss memory is not high, how it will crash, it is very strange. For a long while there is no result. Depressed ~ ~ ~
In the end, I was desperate, I'm going to switch to a JBoss version, and then another JDK to see if that's the problem. But then again, I took a look at the log again and found a problem. There's something behind the Java.lang.OutOfMemoryError: Java.lang.OutOfMemoryError:PermGen space, which seems and java.lang.OutOfMemoryError: Java Heap space is not the same. Finally, I looked for this anomaly!

The full name of PermGen space is permanent Generation space, which refers to the permanent storage area of memory. This section is used to store class and meta information, and class is placed in the PermGen space area when it is loaded, unlike the heap area where instance is stored, GC (garbage Collection) PermGen space will not be cleaned during the main program's run time, so if your app will load many classes, you will likely have permgen space errors. This error is common when the Web server pre-compile the JSP.

Correction method, added in Run.bat:-xms512m-xmx1024m-xx:maxnewsize=256m-xx:maxpermsize=256m
Because a lot of jar packages are referenced in the project, and the class information in these jar packages is loaded into the PermGen space area by JBoss class loader, in the case of JVM default, the size of this part is only 4 m, and in the jar package very much Situation, it is obviously not enough, so the problem can be solved by specifying the maximum value by-xx:maxpermsize=256m.

My JBoss inside loaded 6 applications, jar package and class add up to have about 100m, with this parameter, everything OK, finally the server repaired, found that the inside of the JBoss is so to configure, Ah ~ ~ seems to back up later, it is best to back up JBoss together!
And when the occurrence of Java.lang.OutOfMemoryError:Java heap space This anomaly, by adjusting the-xms512m-xmx1024m this can be solved.
In addition, this two parameter-XX:+USEPARALLELGC-XX:+USEPARALLELOLDGC allows the service to reclaim memory space in parallel. However, when these two parameters are configured, they also take up a certain amount of memory space.

JBoss Memory Overflow Processing

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.