Tomcat java.lang.OutOfMemoryError: PermGen space error
Often time, Tomcat may hits the following java.lang.OutOfMemoryError: PermGen space error.
java.lang.OutOfMemoryError: PermGen space
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
It’s usually happened after the Tomcat restarts a few times.
1. Solution
By default, Tomcat is assigned a very little PermGen memory for the running process. To fix it, increase the PermGen memory settings by using the following Java VM options.
-XX:PermSize<size> - Set initial PermGen Size.
-XX:MaxPermSize<size> - Set the maximum PermGen Size.
In the next step, we will show you how to set the VM options in Tomcat, under Windows and Linux environment.
2. Windows
Tomcat is managed by this script file catalina.bat, dive inside the script, you will find out that catalina.bat always find and run the setenv.bat file to set the environment variables.
{$tomcat-folder}\bin\catalina.bat
//...
rem Get standard environment variables
if not exist "%CATALINA_BASE%\bin\setenv.bat" goto checkSetenvHome
call "%CATALINA_BASE%\bin\setenv.bat"
goto setenvDone
:checkSetenvHome
if exist "%CATALINA_HOME%\bin\setenv.bat" call "%CATALINA_HOME%\bin\setenv.bat"
:setenvDone
//...
2.1 To set the environment variable on Windows, create a setenv.bat manually, and put it into the ${tomcat-folder}\bin folder.
${tomcat-folder}\bin\setenv.bat
set JAVA_OPTS=-Dfile.encoding=UTF-8 -Xms128m -Xmx1024m -XX:PermSize=64m -XX:MaxPermSize=256m
P.S No double quotes, set JAVA_OPTS={value}.
2.2 Restart Tomcat, it will call the setenv.bat file to set the environment variable automatically.
{$tomcat-folder}\bin\catalina.bat restart
Tomcat java.lang.OutOfMemoryError: PermGen space error的更多相关文章
- Tomcat – java.lang.OutOfMemoryError: PermGen space Cause and Solution
Read more: http://javarevisited.blogspot.com/2012/01/tomcat-javalangoutofmemoryerror-permgen.html#ix ...
- myeclipse tomcat java.lang.OutOfMemoryError: PermGen space错误的解决方法
错误代码: java.lang.OutOfMemoryError: PermGen space 原因分析: myeclipse或tomcat的内容分配的不够用,启动失败 解决方法: 1.找到tomca ...
- Eclipse中启动tomcat: java.lang.OutOfMemoryError: PermGen space的解决方法
tomcat启动的时候出现这种错误一般是项目引用了太多的jar包,或者反射生成了太多的类,或者有太多的常量池,导致非堆内存中永久保存区域不够,就有可能会报java.lang.OutOfMemoryEr ...
- Tomcat – Java.Lang.OutOfMemoryError: PermGen Space
很多时候,在开发阶段Tomcat重复的重启过程中会遇到java.lang.OutOfMemoryError : PermGen space 错误. 1 2 3 4 java.lang.OutOfMem ...
- tomcat启动内存溢出三种解决方案:java.lang.OutOfMemoryError:PermGen space解决办法
问题: 严重: Error waiting for multi-thread deployment of WAR files to completejava.util.concurrent.Execu ...
- tomcat启动报错java.lang.OutOfMemoryError:PermGen space解决办法
tomcat启动错误提示: 严重: Error waiting for multi-thread deployment of WAR files to completejava.util.concur ...
- tomcat服务器java.lang.OutOfMemoryError: PermGen space
一挂就报内存溢出 下面是TOMCAT日志 JAVA程序是没有报错, Nov 24, 2009 4:07:02 PM org.apache.catalina.core.ApplicationDispat ...
- Eclipse中启动tomcat报错java.lang.OutOfMemoryError: PermGen space的解决方法
有的项目引用了太多的jar包,或者反射生成了太多的类,异或有太多的常量池,就有可能会报java.lang.OutOfMemoryError: PermGen space的错误, 我们知道可以通过jvm ...
- [转]Tomcat启动java.lang.OutOfMemoryError: PermGen space错误解决
原文地址:http://outofmemory.cn/java/OutOfMemoryError/outofmemoryerror-permgen-space-in-tomcat-with-eclip ...
随机推荐
- #error和line
#error message ----注:message不需要用双引号包围, #error 编译指示字用于自定义程序特有的编译错误消息类似的, #warning用于生成编译警告,但不会停止编译. 在l ...
- PyQt4 Box布局
使用布局类别方式的布局管理器比绝对方式的布局管理器更加灵活实用.它是窗口部件的首选布局管理方式.最基本的布局类别是QHBoxLayout和QVBoxLayout布局管理方式,分别将窗口部件水平和垂直排 ...
- PyQt4重写事件处理方法
PyQt中的事件处理主要以来重写事件处理函数来实现. #!/usr/bin/python # -*- coding: utf-8 -*- import sys from PyQt4 import Qt ...
- JDBC连接oracle地址出错
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 3 ...
- 设计模式-UML类图基础
设计模式之序-UML类图那点事儿 打14年年底就像写那么一个系列,用于讲设计模式的,代码基于JAVA语言,最早接触设计模式是大一还是大二来着,那时候网上有人给推荐书,其中就有设计模式,当时给我推荐的书 ...
- XML的一些点
最近学习Spring会配置许多XML文件,没有系统学习过XML遇到了许多问题,系统的看了一下有些拨云见日的感觉. 推荐学习:http://www.w3school.com.cn/xml/xml_int ...
- Android Processes and Threads
Processes and Threads When an application component starts and the application does not have any oth ...
- Dell、IBM服务器配置远程管理卡
author: headsen chen date: 2018-10-09 14:12:32 1,IBM的服务器: 需要在bios里边进行配置,具体配置如下: , 开机画面过完之后,按F1进入bio ...
- sping整合quartz
很简单,一共需要定义三个bean 需要注意的是每个bean的类型 业务bean(就是我们每次调度需要做的工作) <bean id="quantzjobBean" class= ...
- 电力项目十八--DOM对象的ajax
Ajax操作的核心对象:xmlreq = new XMLHttpRequest(); 第一步:在dictionaryIndex.jsp中添加: <script type="text/j ...