掲示板

LR 6.1 OutOfMemoryError: PermGen space

thumbnail
12年前 に Nilesh Gundecha によって更新されました。

LR 6.1 OutOfMemoryError: PermGen space

Regular Member 投稿: 205 参加年月日: 09/12/01 最新の投稿
I am using Liferay 6.1 CE GA Tomcat Bundle and When I deploy my portlet plugin in it, its repeatedly giving me below exception

Exception in thread "liferay/mail-1" java.lang.OutOfMemoryError: PermGen space
[12:51:42 PM] Akash: SEVERE: Error waiting for multi-thread deployment of directories to completehostConfig.deployWar=Deploying web application archive {0}
java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: PermGen space
        at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:222)
        at java.util.concurrent.FutureTask.get(FutureTask.java:83)
        at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:1018)
        at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:473)
        at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1453)
        at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:295)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
        at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
        at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1338)
        at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1496)
        at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1506)
        at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1485)
        at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.OutOfMemoryError: PermGen space
        at java.lang.Throwable.getStackTraceElement(Native Method)
        at java.lang.Throwable.getOurStackTrace(Throwable.java:591)
        at java.lang.Throwable.printStackTraceAsCause(Throwable.java:529)
        at java.lang.Throwable.printStackTrace(Throwable.java:516)
        at org.springframework.beans.factory.BeanCreationException.printStackTrace(BeanCreationException.java:176)
        at org.apache.log4j.DefaultThrowableRenderer.render(DefaultThrowableRenderer.java:60)
        at org.apache.log4j.spi.ThrowableInformation.getThrowableStrRep(ThrowableInformation.java:87)
        at org.apache.log4j.spi.LoggingEvent.getThrowableStrRep(LoggingEvent.java:413)
        at org.apache.log4j.WriterAppender.subAppend(WriterAppender.java:313)
        at org.apache.log4j.WriterAppender.append(WriterAppender.java:162)
        at org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:251)
        at org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:66)
        at org.apache.log4j.Category.callAppenders(Category.java:206)
        at org.apache.log4j.Category.forcedLog(Category.java:391)
        at org.apache.log4j.Category.log(Category.java:856)
        at org.apache.commons.logging.impl.Log4JLogger.error(Log4JLogger.java:25
        at org.springframework.web.context.ContextLoader.initWebApplicationConte
        at org.springframework.web.context.ContextLoaderListener.contextInitiali
        at com.liferay.portal.spring.context.PortletContextLoaderListener.contex
        at com.liferay.portal.kernel.servlet.PortalClassLoaderServletContextList
        at com.liferay.portal.kernel.util.BasePortalLifecycle.portalInit(BasePor
        at com.liferay.portal.kernel.util.PortalLifecycleUtil.register(PortalLif
        at com.liferay.portal.kernel.util.PortalLifecycleUtil.register(PortalLif
        at com.liferay.portal.kernel.util.BasePortalLifecycle.registerPortalLife
        at com.liferay.portal.kernel.servlet.PortalClassLoaderServletContextList
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContex
        at org.apache.catalina.core.StandardContext.startInternal(StandardContex
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:84
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)
        at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.jav

07:16:04,354 ERROR [ContextLoader:227] Context initialization failed



Here is my tomcat\bin\setenv.sh

JAVA_OPTS="$JAVA_OPTS -Dfile.encoding=UTF8 -Dorg.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES=false -Duser.timezone=GMT [b]-Xmx1024m[/b] -XX:MaxPermSize=256m"


I dont know whats going wrong. Can anyone please gimme some inputs on this?

Regards,
Nilesh
thumbnail
12年前 に Alexander Chow によって更新されました。

RE: LR 6.1 OutOfMemoryError: PermGen space

Liferay Master 投稿: 518 参加年月日: 05/07/20 最新の投稿
I'm not sure what your system configuration is like, but your java.lang.OutOfMemoryError is related to the PermGen space -- which is the parameter "-XX:MaxPermSize=256m". Take a look at the performance tuning section of our user guide.

Alex
thumbnail
12年前 に Nilesh Gundecha によって更新されました。

RE: LR 6.1 OutOfMemoryError: PermGen space

Regular Member 投稿: 205 参加年月日: 09/12/01 最新の投稿
Alexander Chow:
I'm not sure what your system configuration is like, but your java.lang.OutOfMemoryError is related to the PermGen space -- which is the parameter "-XX:MaxPermSize=256m". Take a look at the performance tuning section of our user guide.

Alex


Thanks Alexander. The link you sent was useful.
thumbnail
12年前 に Nilesh Gundecha によって更新されました。

RE: LR 6.1 OutOfMemoryError: PermGen space

Regular Member 投稿: 205 参加年月日: 09/12/01 最新の投稿
Hi Alexander,

After monitoring Liferay 6.1 for some time, I have a feeling that Liferay 6.1 takes huge amount of memory in comparison to what it use to take in Liferay 6.0 (I guess almost double). I am getting OutOfMemoryError quite frequently - its not that I get only when I redeploy my portlet-plugin, but even while using it.

Overview of my Liferay setup: -

- Liferay 6.1.0 CE GA1 with Tomcat 7.0.23 bundle. MySQL 5.5.
- Additional custom 1 ext-plugin, 1 hook-plugin, 2 theme-plugin and 1 portlet-plugin (These I had in LR 6.0 also, now upgraded these to Liferay 6.1)

This setup is hosted on Rackspace Cloud server having 1 GB RAM.
And configured Tomcat JAVA_OPTS is -Xmx1024m -XX:MaxPermSize=256m
I did try few combinations for performance tuning, but still not able too figure out the solution. Or is it that 1 GB RAM is not sufficient for Liferay 6.1.

With this I am facing lot of memory issues and frequent OutOfMemoryError. Whats your view on this?

Regards,

Nilesh
thumbnail
12年前 に Alexander Chow によって更新されました。

RE: LR 6.1 OutOfMemoryError: PermGen space

Liferay Master 投稿: 518 参加年月日: 05/07/20 最新の投稿
Hi Nilesh,

If your server has 1GB of RAM that means Tomcat will not be able to allocate 1GB of RAM… there are other things running in the OS that are going to take up memory. Incidentally, most people will start off with a configuration of -Xms1024m -Xmx1024m -XX:MaxPermSize=256m … but I'm not sure you can even do that, because you will have less than 1GB of RAM to work with. I know you are running your system on a backspace cloud server, but have you experienced a lot of OutOfMemoryError's in your local machine while performance testing? I would suspect your local machine has more than 1GB?

About whether 6.1 uses more memory than 6.0, this is undoubtedly true. How much… I am not entirely sure. However, every new version (especially a major revision like 6.1) is going to have new features and inevitably require more memory. You can disable a lot of things (outlined in the user guide link I gave you above) but that may or may not be enough for you.

Alex
thumbnail
12年前 に Nilesh Gundecha によって更新されました。

RE: LR 6.1 OutOfMemoryError: PermGen space

Regular Member 投稿: 205 参加年月日: 09/12/01 最新の投稿
Thanks for the reply Alex.

In my local development system which has 2 GB RAM installed, I got OutOfMemoryError few times but definitely not very frequent. But ofcourse it has slowed down my computer. My common observation is that My Tomcat process (along with my custom plugins deployed) use to consume around 400Mb - 500Mb with Liferay 6.0. And with Liferay 6.1 its always around 700 MB - 800 Mb range (sometimes crossed 950MB as well).

I am just wondering if this increase in memory usage is just because of the new feature addition, or there is also some memory leak issues.

Regards,
Nilesh
thumbnail
12年前 に Alexander Chow によって更新されました。

RE: LR 6.1 OutOfMemoryError: PermGen space

Liferay Master 投稿: 518 参加年月日: 05/07/20 最新の投稿
I hope we don't have any memory leak issues. We have a team that does a lot of testing in that area so they should've caught the a problem if it exists. Besides, if you are saying "its always around 700 MB - 800 Mb range" then it isn't growing (leaking) at any noticeable rate.

BTW, how are you measuring your memory consumption? If you are using your OS's system console or something like that, this is not an accurate way of measuring memory usage. It may be that your GC needs to be tuned. Use a profiler or try using VisualVM to see how your heap/permgen is being utilised.
thumbnail
12年前 に Hitoshi Ozawa によって更新されました。

RE: LR 6.1 OutOfMemoryError: PermGen space

Liferay Legend 投稿: 7942 参加年月日: 10/03/24 最新の投稿
Alexander, it seems there is a memory leak in CE and not in EE.

http://www.liferay.com/community/forums/-/message_boards/message/13149294
thumbnail
12年前 に Alexander Chow によって更新されました。

RE: LR 6.1 OutOfMemoryError: PermGen space

Liferay Master 投稿: 518 参加年月日: 05/07/20 最新の投稿
From what that post says, it sounds like when they are running 6.1 CE, the client side has a growth in memory usage and only on IE8. Why this is not happening on 6.1 EE (according to their data) I don't know.

Besides, this present mb thread is about a memory leak on the server (permgen), not the client (browser).
thumbnail
12年前 に Olaf Kock によって更新されました。

RE: LR 6.1 OutOfMemoryError: PermGen space

Liferay Legend 投稿: 6403 参加年月日: 08/09/23 最新の投稿
Alexander Chow:
Incidentally, most people will start off with a configuration of -Xms1024m -Xmx1024m -XX:MaxPermSize=256m … but I'm not sure you can even do that, because you will have less than 1GB of RAM to work with.


I want to point to the importance of this setting in production environments: However much memory you assign to your tomcat, make it claim it immediately (-Xms and -Xmx having the same values) - this way you get to see memory problems on startup (when you're most likely around) and not Sunday nights at 3am when the JVM can't claim more memory from the OS.

Speaking of 2G of memory in your local environment: It depends on what else you run in there and if it hits the virtual memory on disk. Naturally, once memory is being swapped out to disk because it doesn't fit the RAM, you'll notice heavy performance degradations. In production I prefer to not have any swap space at all - I want to see the problems when they appear, and not have to guess the cause of sudden performance degradations.
thumbnail
12年前 に Jonathan Quach によって更新されました。

RE: LR 6.1 OutOfMemoryError: PermGen space

New Member 投稿: 1 参加年月日: 12/03/08 最新の投稿
Hey Alexander:

Wondering if you can help decipher this message (new to Liferay) and wondering if this is related to this thread:

09:42:25,476 ERROR [ContextLoader:227] Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean wit
h name 'com.liferay.portal.kernel.util.FastDateFormatFactoryUtil' defined in cla
ss path resource [META-INF/util-spring.xml]: Cannot create inner bean 'com.lifer
ay.portal.util.FastDateFormatFactoryImpl#1e26602' of type [com.liferay.portal.ut
il.FastDateFormatFactoryImpl] while setting bean property 'fastDateFormatFactory
'; nested exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'com.liferay.portal.util.FastDateFormatFactoryImpl
#1e26602' defined in class path resource [META-INF/util-spring.xml]: Instantiati
on of bean failed; nested exception is java.lang.OutOfMemoryError: PermGen space

INFO: Server startup in 16565 ms

Thank you in advance for your assistance.

Jonathan
thumbnail
12年前 に David H Nebinger によって更新されました。

RE: LR 6.1 OutOfMemoryError: PermGen space

Liferay Legend 投稿: 14916 参加年月日: 06/09/02 最新の投稿
Along same lines. Increase the amount of memory Liferay can use and try again.
thumbnail
11年前 に Wole Adetiba によって更新されました。

RE: LR 6.1 OutOfMemoryError: PermGen space

New Member 投稿: 12 参加年月日: 07/11/09 最新の投稿
Hi Nilesh,

I am having similar problems to you. Were you able to work-around this? I am running Liferay + Tomcat bundle on Mac OS. Starting Liferay alone gulps about 800MB of RAM.

Regards,

Wole
thumbnail
11年前 に Nilesh Gundecha によって更新されました。

RE: LR 6.1 OutOfMemoryError: PermGen space

Regular Member 投稿: 205 参加年月日: 09/12/01 最新の投稿
Hi Wole,

Ya, i no more have issues with OutofMemoryError. As per my observation, I found that for running Liferay 6.1, 1 GB of System RAM is not sufficient. It needs to be atleast 2 GB.

You need to make some change in JAVA_OPTS value as it is shown below

JAVA_OPTS="$JAVA_OPTS -Dfile.encoding=UTF8 -Dorg.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES=false -Duser.timezone=GMT [b]-Xms1024m -Xmx1024m -XX:MaxPermSize=512m[/b]"


If you change -XX:MaxPermSize from 256m to 512m, this problem should get resolved.

Regards,
Nilesh
thumbnail
11年前 に Wole Adetiba によって更新されました。

RE: LR 6.1 OutOfMemoryError: PermGen space

New Member 投稿: 12 参加年月日: 07/11/09 最新の投稿
Hi Nilesh,

The change "-XX:MaxPermSize from 256m to 512m" does the magic. Thanks.

Regards,

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

RE: LR 6.1 OutOfMemoryError: PermGen space

Liferay Legend 投稿: 6403 参加年月日: 08/09/23 最新の投稿
...and then change JAVA_OPTS to CATALINA_OPTS if you also use more heapspace and run out of system memory when you try to shut down tomcat...
thumbnail
11年前 に samuel tian によって更新されました。

RE: LR 6.1 OutOfMemoryError: PermGen space

New Member 投稿: 10 参加年月日: 12/06/14 最新の投稿
With default -XX:MaxPermSize=256m, i got perm space error while deploying my portlet.

after increases perm space value to 512m problem gone, but instead i got


09:01:11,842 INFO  [PortalImpl:4873] Current URL /poller/receive generates exception: null
09:01:14,917 INFO  [PortalImpl:4873] Current URL /poller/receive generates exception: null


Every time i navigate from one page to another or refresh the current page. LR Community 6.1.
thumbnail
11年前 に Olaf Kock によって更新されました。

RE: LR 6.1 OutOfMemoryError: PermGen space

Liferay Legend 投稿: 6403 参加年月日: 08/09/23 最新の投稿
I've seen this as well but never followed through and looked at the source for it.

Poller is part of the chat portlet, so obviously you have the chatportlet installed/embedded on the page. AFAIK It's nothing to worry about, just nasty logfile pollution