Exception in Thread "" http-bio-80 "exec-1" Java.lang.OutOfMemoryError:PermGen s Solution

Source: Internet
Author: User
Tags xms

Problem Description:

Exception in Thread "" http-bio-80 "-exec-1" Java.lang.OutOfMemoryError:PermGen s
Exception in Thread "" Http-bio-80 "-exec-1" Java.lang.OutOfMemoryError:PermGen space
at Java.lang.ClassLoader.defineClass1 (Native Method)
at Java.lang.ClassLoader.defineClass (classloader.java:621)
at Java.security.SecureClassLoader.defineClass (secureclassloader.java:124)
at Java.net.URLClassLoader.defineClass (urlclassloader.java:260)
at java.net.urlclassloader.access$000 ( urlclassloader.java:56)
at Java.net.urlclassloader$1.run (urlclassloader.java:195)
at Java.security.AccessController.doPrivileged (Native Method)
at Java.net.URLClassLoader.findClass ( urlclassloader.java:188)
at Java.lang.ClassLoader.loadClass (classloader.java:307)
at Java.lang.ClassLoader.loadClass (classloader.java:252)
at Java.lang.ClassLoader.loadClassInternal ( classloader.java:320)
at Org.eclipse.jdt.internal.compiler.ast.TypeReference.internalResolveType ( typereference.java:113)

In the project, the Web project often appears back to the exception in thread "HTTP-BIO-8080-EXEC-11" java.lang.OutOfMemoryError:PermGen space issue. The solution is:

Window--preferences---tomcat---JVM Setting------append to JVM Parameters

Click Add to copy this parameter in

-xms512m-xmx512m-xx:maxnewsize=512m-xx:maxpermsize=512m Click OK. Tomcat started memory overflow problem exception in thread "" http-bio-8080 "-exec-6 The phenomenon is as follows:TOMCAT7 startup, the background throws the following exception, the front desk has been unable to login Exception in thread "" http-bio-8080 "-exec-6" Java.lang.OutOfMemoryError:PermGen space Ex Ception in Thread "" http-bio-8080 "-exec-9" Java.lang.OutOfMemoryError:PermGen space Exception in thread " Schedulerfactory_worker-3 "Java.lang.OutOfMemoryError:PermGen space Exception in thread" "http-bio-8080"-exec-2 " Java.lang.OutOfMemoryError:PermGen space Exception in thread "Timer-0" Java.lang.OutOfMemoryError:PermGen space
Solution:Increases boot memory parameters for tomcat-specified JDK-xms128m-xmx512m-xx:permsize=128m-xx:maxpermsize=128m

This is illustrated below:MyEclipse menu in software, Windows---preference----tomcat

Java.lang.OutOfMemoryError:PermGen space and how to solve it

PermGen space is the full name of permanent Generation space, refers to the memory of the permanent storage area Outofmemoryerror:permgen space from the surface is the memory benefits, the solution must be to increase memory. Tell me why memory Benefits: 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:-xms256m-xmx256m-xx:maxnewsize=256m-xx:maxpermsize=256m

A outofmemory error occurred while redeploy in Tomcat.  There are several reasons for this: 1, Proxool is used because the Proxool contains an older version of Cglib.  2, log4j, preferably not, only with common-logging 3, the old version of Cglib, quickly update to the latest version. 4, update to the latest hibernate3.2 3,

Here, for example, the Tomcat environment, other Web servers, such as Jboss,weblogic, are the same reason.

First, Java.lang.OutOfMemoryError:PermGen space PermGen space is the full name of permanent Generation space, refers to the memory of the permanent storage area, This memory is primarily stored by the JVM with class and meta information, and class is placed in PermGen space when it is loader, unlike the heap area where the class instance (Instance) is stored, GC (garbage Collection) PermGen space will not be cleaned up during the main program run time, so if you have many classes in your application, you are likely to have PermGen space errors, which are common when the Web server pre-compile the JSP. If you have a large number of third-party jars under your web app that are larger than the JVM's default size (4M), this error message will be generated.

Workaround: Manually set the MaxPermSize size modification tomcat_home/bin/catalina.sh on the "echo" Using catalina_base: $CATALINA _base "" Add the following line: java_opts = "-server-xx:permsize=64m-xx:maxpermsize=128m

Recommendation: Move the same third-party jar files to the Tomcat/shared/lib directory, which can reduce the memory consumption of the jar document.

Java.lang.OutOfMemoryError:Java Heap Space Heap Size setting the JVM heap is the setting of the amount of memory space that the JVM can provision during the run of the Java program. The JVM automatically sets the heap when it starts The value of size whose initial space (that is,-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 the-XMN-XMS-XMX provided by the JVM to set it up. The size of Heap size is the sum of young Generation and tenured generaion. Tip: This exception message is thrown in the JVM if 98% of the time is used for GC and the available heap size is less than 2%. Tip: The Heap Size does not exceed 80% of the available physical memory, generally the-XMS and-XMX options are set to the same, and the-XMX value of-xmn is 1/4.

Workaround: Manually set the heap size to modify tomcat_home/bin/catalina.sh on the "echo" Using catalina_base: $CATALINA _base "" Add the following line above: java_opts= "- server-xms800m-xmx800m-xx:maxnewsize=256m "

Third, example, the following gives the parameters of the JAVA JVM in the 1G Memory environment reference: java_opts= "-SERVER-XMS800M-XMX800M-XX:PERMSIZE=64M-XX:MAXNEWSIZE=256M-XX: Maxpermsize=128m-djava.awt.headless=true "

Out of Memory (OutOfMemory)-the application displays an "Out of memory" error because of memory exhaustion in the Java heap or local memory. Memory leaks The persistent memory growth of the-java heap or local memory eventually results in a low memory state. The technique for debugging a memory leak state is the same as debugging a low-memory state.

Java heap-This is the memory that the JVM uses to allocate Java objects. If the JVM cannot get more memory in the Java heap to allocate more Java objects, it will throw out Java out-of-memory (java.lang.OutOfMemoryError) errors. By default, the application crashes. Local memory-This is the memory that the JVM uses for its internal operations. If the JVM cannot get more local memory, it throws a local out-of-memory (local OutOfMemoryError) error. This typically occurs when the process reaches the operating system's process size limit, or when the computer runs out of RAM and swap space. Process Size-The process size will be the sum of the memory consumed by the Java heap, local memory, and the loaded executables and libraries. On a 32-bit operating system, the virtual address space for a process can be up to 4 GB. From this 4 GB of memory, the operating system kernel retains a portion of its memory (typically 1-2 GB) for itself. The remaining memory is available for the application.

2. A Java Virtual machine is implemented in memory in accordance with a software implementation of the specification. The JVM is generated by the JRE (Java Runtime Environment) installed on the machine. Typically, a JVM is generated each time a application is run, but there can be multiple programs in the same JVM.

You can use the command java-x to view non-standard (non-standard) program run options, the following 3 are what I care about:

-XMS Set initial Java heap size-xmx set maximum Java heap SIZE-XSS set Java thread stack size

-XMX sets the maximum amount of memory that the application (not the JVM) can use, and this value should not be set too large, exceeding the machine memory. For example: java-xmx50m TESTMEMORY-XMS Sets the size of the memory stack when the program is initialized. Can sometimes be used to change the efficiency of a program's operation. For example, run a program that consumes about 20M of memory using the following method testmemory:java-xms50m Testmemory

Use this method to get the amount of space used in the application

/**//* Returns The total amount of memory in the Java virtual machine. The value returned by this method is vary over time and depending on the host environment. */ System.out.println (Runtime.getruntime (). TotalMemory ());

3. View the memory usage of the Java process: Windows Task Manager increases the value of the heap that runs the app

Command line execution Mode java-xms256-xmx512m app

Tomcat execution mode under Windows, in file {Tomcat_home}/bin/catalina.bat

The following settings can be added at the beginning of the file:

Set java_opts=-xms256m-xmx512m

Under Unix, in front of the file {tomcat_home}/bin/catalina.sh, you can add the following settings:

java_opts= '-xms256m-xmx512m '

Exception in Thread "" http-bio-80 "exec-1" Java.lang.OutOfMemoryError:PermGen s Solution

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.