Tomcat java. Lang. outofmemoryerror

Source: Internet
Author: User

After 64-bit jdk7_17 is installed, Tomcat 7 always reports a memory overflow error.

After the adjustment, it still does not work, and has to switch back to the 32-bit JDK.

Adjust the memory Configuration:

export JAVA_OPTS="-server -Xmx1536M -XX:MaxPermSize=512m -Dfile.encoding=UTF-8"

Save as % tomcat_home %/bin/setenv. bat

Parameter description:

-Server

Select the Java hotspot server VM.
For more information, see server-class machine detection [http://docs.oracle.com/javase/1.5.0/docs/guide/vm/server-class.html]

-Xmxn
Specify the maximum size, in bytes, of the memory allocation pool. this value must a multiple of 1024 greater than 2 MB. append the letter K or K to indicate kilobytes, or M or m to indicate megabytes. the default value is 64 MB. examples:

-Xmx83886080
-Xmx81920k
-Xmx80m

-XX: maxpermsize = 64 m
Size of the permanent generation. [5.0 and newer: 64 bit VMS are scaled 30% larger; 1.4 amd64: 96 m; 1.3.1-Client: 32 M.]

-Dproperty = Value
Set a system property value. If value is a string that contains spaces, you must enclose the string in double quotes:

Java-dfoo = "some string" someclass

References:

[1] Artur ejsmont. http://artur.ejsmont.org/blog/content/fixing-javalangoutofmemoryerror-permgen-out-of-memory-in-grails-sts-and-tomcat

[2] Java-the Java application launcher. http://docs.oracle.com/javase/1.5.0/docs/tooldocs/windows/java.html

[3] Java hotspot VM options. http://www.oracle.com/technetwork/java/javase/tech/vmoptions-jsp-140102.html

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.