Difference between revisions of "ZH/Case-Study-01-Journal-34"
From ADempiere
This Wiki is read-only for reference purposes to avoid broken links.
(how to deal with error or bug in ADempiere) |
(→2010-03-05-报错-java.lang.OutOfMemoryError: PermGen space) |
||
Line 10: | Line 10: | ||
==2010-03-05-报错-java.lang.OutOfMemoryError: PermGen space== | ==2010-03-05-报错-java.lang.OutOfMemoryError: PermGen space== | ||
* 可能是由于这些新制作的JasperReport报表比较复杂,通过Web界面打开报表时报告java.lang.OutOfMemoryError: PermGen space错误,而通过Swing客户端打开就没有此问题。 | * 可能是由于这些新制作的JasperReport报表比较复杂,通过Web界面打开报表时报告java.lang.OutOfMemoryError: PermGen space错误,而通过Swing客户端打开就没有此问题。 | ||
− | * | + | * 有几位朋友也遇到了这个问题,但是都未能解决。 |
*# [http://sourceforge.net/tracker/index.php?func=detail&aid=3176592&group_id=176962&atid=955896 PermGen error when run as windows' service - ID: 3176592] | *# [http://sourceforge.net/tracker/index.php?func=detail&aid=3176592&group_id=176962&atid=955896 PermGen error when run as windows' service - ID: 3176592] | ||
*# [http://bbs.erp100.com/thread-50771-1-1.html 最近想测试OpenBravo生产模块,请高人指教] (见第3楼) | *# [http://bbs.erp100.com/thread-50771-1-1.html 最近想测试OpenBravo生产模块,请高人指教] (见第3楼) | ||
* 后来在找到[http://www.freshblurbs.com/explaining-java-lang-outofmemoryerror-permgen-space Explaining java.lang.OutOfMemoryError: PermGen space]这篇文章,摘录如下: | * 后来在找到[http://www.freshblurbs.com/explaining-java-lang-outofmemoryerror-permgen-space Explaining java.lang.OutOfMemoryError: PermGen space]这篇文章,摘录如下: | ||
− | :There is a third generation too - Permanent Generation. The permanent generation is special because it holds meta-data describing user classes (classes that are not part of the Java language). Examples of such meta-data are objects describing | + | :There is a third generation too - Permanent Generation. The permanent generation is special because it holds meta-data describing user classes (classes that are not part of the Java language). Examples of such meta-data are objects describing classes and methods and they are stored in the Permanent Generation. Applications with large code-base can quickly fill up this segment of the heap which will cause java.lang.OutOfMemoryError: PermGen no matter how high your -Xmx and how much memory you have on the machine. |
− | classes and methods and they are stored in the Permanent Generation. Applications with large code-base can quickly fill up this segment of the heap which will cause java.lang.OutOfMemoryError: PermGen no matter how high your -Xmx and how much memory you have on the machine. | + | |
:Sun JVMs allow you to resize the different generations of the heap, including the permanent generation. On a Sun JVM (1.3.1 and above) you can configure the initial permanent generation size and the maximum permanent generation size. | :Sun JVMs allow you to resize the different generations of the heap, including the permanent generation. On a Sun JVM (1.3.1 and above) you can configure the initial permanent generation size and the maximum permanent generation size. | ||
Line 24: | Line 23: | ||
* 于是按照这个方法尝试一下。 | * 于是按照这个方法尝试一下。 | ||
# 打开文件:$ADEMPIERE_HOME/utils/myEnvironment.sh | # 打开文件:$ADEMPIERE_HOME/utils/myEnvironment.sh | ||
− | # 找到:ADEMPIERE_JAVA_OPTIONS="-Xms64M -Xmx512M -DADEMPIERE_HOME=$ADEMPIERE_HOME" | + | # 找到:ADEMPIERE_JAVA_OPTIONS="'''-Xms64M -Xmx512M''' -DADEMPIERE_HOME=$ADEMPIERE_HOME" |
− | # 改为:ADEMPIERE_JAVA_OPTIONS="-Xms512M -Xmx512M -DADEMPIERE_HOME=$ADEMPIERE_HOME" 。也就是把Xms与Xmx调整成大小一样。 | + | # 改为:ADEMPIERE_JAVA_OPTIONS="'''-Xms512M -Xmx512M''' -DADEMPIERE_HOME=$ADEMPIERE_HOME" 。也就是把Xms与Xmx调整成大小一样。 |
# 重新启动Server,OK 问题解决。 | # 重新启动Server,OK 问题解决。 | ||
− | * | + | * 下面附上JBoss Sever后台报错具体内容: |
<pre> | <pre> | ||
...OfMemoryError: PermGen space | ...OfMemoryError: PermGen space |
Revision as of 20:07, 4 March 2011
Contents
实施日志-34-报错或Bug简易处理
- 本文属于机械装备制造业进销存实施案例——ADempiere ERP案例研究之一。
- 本文记录ADempiere ERP项目实施的过程
背景说明
- 对ADempiere的报错或Bug进行简易处理,本文不涉及复杂的debug调试。
2010-03-05-报错-java.lang.OutOfMemoryError: PermGen space
- 可能是由于这些新制作的JasperReport报表比较复杂,通过Web界面打开报表时报告java.lang.OutOfMemoryError: PermGen space错误,而通过Swing客户端打开就没有此问题。
- 有几位朋友也遇到了这个问题,但是都未能解决。
- 后来在找到Explaining java.lang.OutOfMemoryError: PermGen space这篇文章,摘录如下:
- There is a third generation too - Permanent Generation. The permanent generation is special because it holds meta-data describing user classes (classes that are not part of the Java language). Examples of such meta-data are objects describing classes and methods and they are stored in the Permanent Generation. Applications with large code-base can quickly fill up this segment of the heap which will cause java.lang.OutOfMemoryError: PermGen no matter how high your -Xmx and how much memory you have on the machine.
- Sun JVMs allow you to resize the different generations of the heap, including the permanent generation. On a Sun JVM (1.3.1 and above) you can configure the initial permanent generation size and the maximum permanent generation size.
- To set a new initial size on Sun JVM use the -XX:PermSize=64m option when starting the virtual machine. To set the maximum permanent generation size use -XX:MaxPermSize=128m option. If you set the initial size and maximum size to equal values you may be able to avoid some full garbage collections that may occur if/when the permanent generation needs to be resized.
- 于是按照这个方法尝试一下。
- 打开文件:$ADEMPIERE_HOME/utils/myEnvironment.sh
- 找到:ADEMPIERE_JAVA_OPTIONS="-Xms64M -Xmx512M -DADEMPIERE_HOME=$ADEMPIERE_HOME"
- 改为:ADEMPIERE_JAVA_OPTIONS="-Xms512M -Xmx512M -DADEMPIERE_HOME=$ADEMPIERE_HOME" 。也就是把Xms与Xmx调整成大小一样。
- 重新启动Server,OK 问题解决。
- 下面附上JBoss Sever后台报错具体内容:
...OfMemoryError: PermGen space >> at java.lang.Class.getDeclaredConstructors0(Native Method) >> at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389) >> at java.lang.Class.getConstructor0(Class.java:2699) >> at java.lang.Class.newInstance0(Class.java:326) >> at java.lang.Class.newInstance(Class.java:308) >> at sun.reflect.MethodAccessorGenerator$1.run(MethodAccessorGenerator.java:381) >> at java.security.AccessController.doPrivileged(Native Method) >> at sun.reflect.MethodAccessorGenerator.generate(MethodAccessorGenerator.java:377) >> at sun.reflect.MethodAccessorGenerator.generateSerializationConstructor(MethodAccessorGenerator.java:95) >> at sun.reflect.ReflectionFactory.newConstructorForSerialization(ReflectionFactory.java:313) >> at java.io.ObjectStreamClass.getSerializableConstructor(ObjectStreamClass.java:1327) >> at java.io.ObjectStreamClass.access$1500(ObjectStreamClass.java:52) >> at java.io.ObjectStreamClass$2.run(ObjectStreamClass.java:437) >> at java.security.AccessController.doPrivileged(Native Method) >> at java.io.ObjectStreamClass.<init>(ObjectStreamClass.java:413) >> at java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:310) >> at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:547) >> at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1582) >> at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1495) >> at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1731) >> at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328) >> at java.io.ObjectInputStream.readObject(ObjectInputStream.java:350) >> at java.util.ArrayList.readObject(ArrayList.java:593) >> at sun.reflect.GeneratedMethodAccessor596.invoke(Unknown Source) >> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) >> at java.lang.reflect.Method.invoke(Method.java:597) >> at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:974) >> at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1848) >> at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1752) >> at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328) >> at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1946) >> at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:479) [17] 13:12:37,251 ERROR [STDERR] ===========> zkoss.handleError:1130: >>java.lang.OutOfMemoryError: PermGen space [16] 13:12:37,256 ERROR [STDERR] -----------> MIssue.set_ValueNoCheck: ReleaseNo - Value too long - truncated to length=4 [16] 13:12:37,256 ERROR [STDERR] -----------> MIssue.set_ValueNoCheck: ReleaseNo - Value too long - truncated to length=4 [16] 13:12:37,306 ERROR [STDERR] ===========> zkoss.handleError:1130: >>java.lang.OutOfMemoryError: PermGen space [16]
链接
About this page
- This page is about how to deal with error or bug in ADempiere in Case Study 01, focusing on simple cases, without concerning complicated debugging.