掲示板

java.lang.OutOfMemoryError: PermGen space

15年前 に Hari Krishnan Rathnakumar によって更新されました。

java.lang.OutOfMemoryError: PermGen space

Junior Member 投稿: 60 参加年月日: 08/12/16 最新の投稿
Hi liferay guys,

I was finished liferay integration with tomcat6.0, but whenever I try to upload(Using Document Library) any file I got below exception

javax.servlet.ServletException: Servlet execution threw an exception
com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:98)
com.liferay.portal.servlet.filters.virtualhost.VirtualHostFilter.doFilter(VirtualHostFilter.java:149)
com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:98)
com.liferay.portal.servlet.filters.sessionid.SessionIdFilter.doFilter(SessionIdFilter.java:81)
com.liferay.portal.servlet.FriendlyURLServlet.service(FriendlyURLServlet.java:137)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:98)
com.liferay.filters.strip.StripFilter.doFilter(StripFilter.java:88)
com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:98)
com.liferay.filters.compression.CompressionFilter.doFilter(CompressionFilter.java:109)
com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:98)
com.liferay.filters.secure.SecureFilter.doFilter(SecureFilter.java:150)
com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:98)
com.liferay.filters.doubleclick.DoubleClickFilter.doFilter(DoubleClickFilter.java:132)
com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:98)
com.liferay.portal.servlet.filters.layoutcache.LayoutCacheFilter.doFilter(LayoutCacheFilter.java:190)
com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:98)
com.liferay.portal.servlet.filters.autologin.AutoLoginFilter.doFilter(AutoLoginFilter.java:108)
com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:98)
com.liferay.portal.servlet.filters.virtualhost.VirtualHostFilter.doFilter(VirtualHostFilter.java:173)
com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:98)
com.liferay.portal.servlet.filters.sessionid.SessionIdFilter.doFilter(SessionIdFilter.java:81)
root cause
java.lang.OutOfMemoryError: PermGen space
java.lang.ClassLoader.defineClass1(Native Method)
java.lang.ClassLoader.defineClass(ClassLoader.java:620)
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1817)
org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:872)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1325)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204)
java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
java.lang.ClassLoader.defineClass1(Native Method)
java.lang.ClassLoader.defineClass(ClassLoader.java:620)
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1817)
org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:872)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1325)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204)
java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
org.apache.jackrabbit.core.WorkspaceImpl.<init>(WorkspaceImpl.java:134)
org.apache.jackrabbit.core.SessionImpl.createWorkspaceInstance(SessionImpl.java:285)
org.apache.jackrabbit.core.SessionImpl.<init>(SessionImpl.java:253)
org.apache.jackrabbit.core.SystemSession.<init>(SystemSession.java:66)
org.apache.jackrabbit.core.SystemSession.create(SystemSession.java:54)
org.apache.jackrabbit.core.RepositoryImpl$WorkspaceInfo.getSystemSession(RepositoryImpl.java:1634)
org.apache.jackrabbit.core.RepositoryImpl.initWorkspace(RepositoryImpl.java:546)
org.apache.jackrabbit.core.RepositoryImpl.initStartupWorkspaces(RepositoryImpl.java:379)
org.apache.jackrabbit.core.RepositoryImpl.<init>(RepositoryImpl.java:286)
org.apache.jackrabbit.core.RepositoryImpl.create(RepositoryImpl.java:521)
org.apache.jackrabbit.core.TransientRepository$2.getRepository(TransientRepository.java:245)
org.apache.jackrabbit.core.TransientRepository.startRepository(TransientRepository.java:265)
org.apache.jackrabbit.core.TransientRepository.login(TransientRepository.java:333)
com.liferay.portal.jcr.jackrabbit.JCRFactoryImpl.createSession(JCRFactoryImpl.java:73)
com.liferay.portal.jcr.JCRFactoryUtil.createSession(JCRFactoryUtil.java:53)
com.liferay.portal.jcr.JCRFactoryUtil.createSession(JCRFactoryUtil.java:57)

how can I solve this problem. Any body help me.

Any help is highly appreciated

Hari R
thumbnail
15年前 に Suresh Nimmakayala によって更新されました。

RE: java.lang.OutOfMemoryError: PermGen space

Liferay Master 投稿: 690 参加年月日: 04/08/18 最新の投稿
all depends on how much ram you have on that system and memory settings. look in the forum on by 'PermGen space'. you will find a answer

Cheers
Suresh
thumbnail
15年前 に Derek Nerenberg によって更新されました。

RE: java.lang.OutOfMemoryError: PermGen space

Junior Member 投稿: 41 参加年月日: 06/05/09 最新の投稿
I've had this problem in Eclipse trying to color code very large JSP or XML files. I'm sure your issue is much different, but the symptom is the same. Check out http://www.jroller.com/agileanswers/entry/preventing_java_s_java_lang as a starting point to debug the issue.
15年前 に Hari Krishnan R によって更新されました。

RE: java.lang.OutOfMemoryError: PermGen space

Junior Member 投稿: 60 参加年月日: 08/12/16 最新の投稿
Hi Suresh and Derek

Thank you for your reply,

My machine having 1 GB ram, and I have also increase the java heap memory for tomcat server
By appending the below line in catalina.bat
set JAVA_OPTS ="-Xms256m -Xmx2048m -XX:MaxPermSize=2048m"
Kindly suggests me to how to sort out this pblm.

Thanks in advance.
thumbnail
15年前 に Mika Koivisto によって更新されました。

RE: java.lang.OutOfMemoryError: PermGen space

Liferay Legend 投稿: 1519 参加年月日: 06/08/07 最新の投稿
Your current memory settings would require more than 5GB of physical RAM. With only 1GB of physical RAM you could use following settings
set JAVA_OPTS ="-Xms256m -Xmx512m -XX:MaxPermSize=196m"


This might not be enough for your application and if that's the case then you need to add more RAM to your machine in order to increase java heap size or perm size. You should notice that above java memory settings won't leave any space for your OS. In Windows you need to reserve a minimum of 512MB for the OS.
15年前 に Hari Krishnan R によって更新されました。

RE: java.lang.OutOfMemoryError: PermGen space

Junior Member 投稿: 60 参加年月日: 08/12/16 最新の投稿
Thanks Guys for your help.

I need one more help I want to skip all the pages between login and public Organization Page.I need to change the code for that.
From where can i change that code?.kindly let me know the details.


my need id: sing in -------------to-----------> (welcome/my places/<organization name>) public page



how can i find source.....

Thanks in advance
thumbnail
14年前 に Ziggy . によって更新されました。

RE: java.lang.OutOfMemoryError: PermGen space

Expert 投稿: 293 参加年月日: 08/06/08 最新の投稿
Mika Koivisto:
Your current memory settings would require more than 5GB of physical RAM. With only 1GB of physical RAM you could use following settings
set JAVA_OPTS ="-Xms256m -Xmx512m -XX:MaxPermSize=196m"


This might not be enough for your application and if that's the case then you need to add more RAM to your machine in order to increase java heap size or perm size. You should notice that above java memory settings won't leave any space for your OS. In Windows you need to reserve a minimum of 512MB for the OS.


Hi could you explain to me how this memory allocation works? I have a machine with 2GB physical im getting out of memory errors. How do i set the values for a 2GB machine?

And also can the swap partition be used to help?

Thanks
thumbnail
14年前 に Olaf Kock によって更新されました。

RE: java.lang.OutOfMemoryError: PermGen space

Liferay Legend 投稿: 6403 参加年月日: 08/09/23 最新の投稿
Swap space helps and doesn't help at the same time: It can prevent OutOfMemory conditions because you mimic more ram than you actually have. On the other hand it does so through notable performance impacts when the swap space it hit. Still better than an application stopping to work, but not desirable.

Regarding the settings: These are Sun JRE settings, especially the -XX is Sun proprietary. You can find loads of good resorces regarding MaxPermGen on the net - there's some nice explanations what areas of memory the options are denoting and why you want to control them in certain conditions.
thumbnail
14年前 に Zsolt Balogh によって更新されました。

RE: java.lang.OutOfMemoryError: PermGen space

Expert 投稿: 463 参加年月日: 09/03/23 最新の投稿
If you are developing liferay, here are my settings(tomcat):

-Xms265m -Xmx768m -XX:MaxPermSize=512m

I don't know if it's recommended or not, but I have no OutOfMemoryErrors with these.

For production it's not enough in most cases, I have a portal running with these(jboss):

-Xms6144m -Xmx8192m -XX:MaxPermSize=512m -XXemoticonermSize=256m
thumbnail
14年前 に Ziggy . によって更新されました。

RE: java.lang.OutOfMemoryError: PermGen space

Expert 投稿: 293 参加年月日: 08/06/08 最新の投稿
Zsolt, How much memory have you got on that production environment?
thumbnail
14年前 に Zsolt Balogh によって更新されました。

RE: java.lang.OutOfMemoryError: PermGen space

Expert 投稿: 463 参加年月日: 09/03/23 最新の投稿
16G

But it's a really heavy portal with a lot of communities, users and visitors.
thumbnail
14年前 に Ziggy . によって更新されました。

RE: java.lang.OutOfMemoryError: PermGen space

Expert 投稿: 293 参加年月日: 08/06/08 最新の投稿
Thats a lot of memory!
I am only running with 2GB but hoping to upgrade soon.
thumbnail
14年前 に Olaf Kock によって更新されました。

RE: java.lang.OutOfMemoryError: PermGen space

Liferay Legend 投稿: 6403 参加年月日: 08/09/23 最新の投稿
We have sites running with even less than 2GB - though they are relatively low traffic and the machines are virtual, so adding memory is a matter of clicking the mouse a few times. So far we're happy with that.
thumbnail
13年前 に Krati Gupta によって更新されました。

RE: java.lang.OutOfMemoryError: PermGen space

Regular Member 投稿: 119 参加年月日: 08/12/05 最新の投稿
Hi All,

I am using 4 GB of RAM and -Xms512m -Xmx1500m -XX:MaxPermSize=128m
and after that I am getting the outOfMemory error . So please tell us what should be the ideal seeting for the production environment .
thumbnail
13年前 に Olaf Kock によって更新されました。

RE: java.lang.OutOfMemoryError: PermGen space

Liferay Legend 投稿: 6403 参加年月日: 08/09/23 最新の投稿
The ideal setting depends on what applications/portlets you're running and what the load of your system is. For production systems I'd recommend to have -Xmx and -Xms to be the same, as you sooner or later will use up all that memory, and you don't want that to fail (or trigger swapping) at some unforseeable point in time but rather immediately on start up.

Regarding your OutOfMemory: Determine if its heap space or PermGen space and up the appropriate value. You might get some value from the performance whitepaper