Java. Lang. outofmemoryerror: this exception occurs when Java heap space reads a file.

Source: Internet
Author: User
Tags xms

Exception

 
Org. apache. jasper. jasperexception: javax. servlet. servletexception: Java. lang. outofmemoryerror: Java heap spaceorg. apache. jasper. servlet. jspservletwrapper. handlejspexception (jspservletwrapper. java: 505) Org. apache. jasper. servlet. jspservletwrapper. service (jspservletwrapper. java: 417) Org. apache. jasper. servlet. jspservlet. servicejspfile (jspservlet. java: 320) Org. apache. jasper. servlet. jspservlet. service (jspservlet. java: 266) javax. servlet. HTTP. httpservlet. service (httpservlet. java: 803) COM. waytide. filter. encodingfilter. dofilter (encodingfilter. java: 35)

 

Root Cause

Javax. servlet. servletexception: Java. lang. outofmemoryerror: Java heap spaceorg. apache. jasper. runtime. pagecontextimpl. dohandlepageexception (pagecontextimpl. java: 850) Org. apache. jasper. runtime. pagecontextimpl. handlepageexception (pagecontextimpl. java: 779) Org. apache. JSP. mms_005fmanage_005fview_jsp. _ jspservice (mms_005fmanage_005fview_jsp.java: 322) Org. apache. jasper. runtime. httpjspbase. service (httpjspbase. java: 70) javax. servlet. HTTP. httpservlet. service (httpservlet. java: 803) Org. apache. jasper. servlet. jspservletwrapper. service (jspservletwrapper. java: 393) Org. apache. jasper. servlet. jspservlet. servicejspfile (jspservlet. java: 320) Org. apache. jasper. servlet. jspservlet. service (jspservlet. java: 266) javax. servlet. HTTP. httpservlet. service (httpservlet. java: 803) COM. waytide. filter. encodingfilter. dofilter (encodingfilter. java: 35)

 

Root Cause

Java. Lang. outofmemoryerror: Java heap Space
 
This exception occurs when a binfile needs to be parsed. You have found many solutions to modify the virtual memory of Tomcat or JDK. But it cannot solve the problem.
 
There are also many friends who have encountered similar problems, but most of the proposed solutions are to modify virtual memory and so on. Some may be valid. I have met before. You can modify it.
 
However, this exception occurs when a file is read on a JSP page.
 
At last, it seems that a post cannot read too much content to the page.
 
The following is a common solution:
Open tomcathome/bin/tomcat5w.exe and click the Java tab. The following two items are displayed: initial memory pool and maximum memory pool. initial memory pool: memory size set for initialization. Maximum memory pool: The maximum memory size. Set the initial memory pool to 64 mb .!!! Success !!! After the configuration is complete, press OK and restart tomcat. You will find that the JVM available memory in Tomcat has changed (anyoneking). Take the Tomcat environment as an example. Other Web servers, such as JBoss, webLogic is the same principle. I. java. lang. outofmemoryerror: The full name of permgen space is permanent generation space, which refers to the permanent storage area of the memory. This memory is mainly used by JVM to store class and meta information, when a class is loaded, it is placed in the permgen space. Unlike the heap region of the instance, GC (garbage collection) is not stored in the master Program Permgen space is cleaned up during runtime. Therefore, if your application has many classes, the permgen space error may occur. This error is common when the web server pre-compile the JSP. If your web app uses a large number of third-party jar files and the size exceeds the default JVM size (4 MB), this error message is generated. Solution: manually set maxpermsize to modify tomcat_home/bin/Catalina. sh Add the following lines to "Echo" using catalina_base: $ catalina_base ": java_opts ="-server-XX: permsize = 64 m-XX: maxpermsize = 128 M ". We recommend that you: move the same third-party jar files to the tomcat/shared/lib directory to reduce the memory usage of jar files. Ii. java. lang. outofmemoryerror: Java heap spaceheap size specifies the JVM heap setting. This refers to the setting of memory space that can be provisioned by JVM during Java program running. the JVM automatically sets the heap size value at startup. The initial space (-XMS) is 1/64 of the physical memory, and the maximum space (-xmx) is 1/4 of the physical memory. You can use options such as-xmn-XMS-xmx provided by JVM to set the configuration. The heap size is the sum of young generation and tenured generaion. Tip: if 98% is used for GC and the available heap size is less than 2% in JVM, this exception is thrown. Tip: the heap size should not exceed 80% of the available physical memory. Generally, you must set the-XMS and-xmx options to the same, and-xmn to the-xmx value of 1/4. Solution: manually set heap size to modify tomcat_home/bin/Catalina. sh Add the following lines to "Echo" using catalina_base: $ catalina_base ": java_opts ="-server-xms800m-xmx800m-XX: maxnewsize = 256 m"
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.