構造的に表示 平面上に表示 ツリー上に表示
スレッド [ 前へ | 次へ ]
toggle
Nilesh Gundecha
LR 6.1 OutOfMemoryError: PermGen space
2012/01/23 23:32
答え

Nilesh Gundecha

ランク: Regular Member

投稿: 194

参加年月日: 2009/11/30

最近の投稿

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

 1Exception in thread "liferay/mail-1" java.lang.OutOfMemoryError: PermGen space
 2[12:51:42 PM] Akash: SEVERE: Error waiting for multi-thread deployment of directories to completehostConfig.deployWar=Deploying web application archive {0}
 3java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: PermGen space
 4        at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:222)
 5        at java.util.concurrent.FutureTask.get(FutureTask.java:83)
 6        at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:1018)
 7        at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:473)
 8        at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1453)
 9        at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:295)
10        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
11        at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
12        at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1338)
13        at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1496)
14        at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1506)
15        at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1485)
16        at java.lang.Thread.run(Thread.java:662)
17Caused by: java.lang.OutOfMemoryError: PermGen space
18        at java.lang.Throwable.getStackTraceElement(Native Method)
19        at java.lang.Throwable.getOurStackTrace(Throwable.java:591)
20        at java.lang.Throwable.printStackTraceAsCause(Throwable.java:529)
21        at java.lang.Throwable.printStackTrace(Throwable.java:516)
22        at org.springframework.beans.factory.BeanCreationException.printStackTrace(BeanCreationException.java:176)
23        at org.apache.log4j.DefaultThrowableRenderer.render(DefaultThrowableRenderer.java:60)
24        at org.apache.log4j.spi.ThrowableInformation.getThrowableStrRep(ThrowableInformation.java:87)
25        at org.apache.log4j.spi.LoggingEvent.getThrowableStrRep(LoggingEvent.java:413)
26        at org.apache.log4j.WriterAppender.subAppend(WriterAppender.java:313)
27        at org.apache.log4j.WriterAppender.append(WriterAppender.java:162)
28        at org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:251)
29        at org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:66)
30        at org.apache.log4j.Category.callAppenders(Category.java:206)
31        at org.apache.log4j.Category.forcedLog(Category.java:391)
32        at org.apache.log4j.Category.log(Category.java:856)
33        at org.apache.commons.logging.impl.Log4JLogger.error(Log4JLogger.java:25
34        at org.springframework.web.context.ContextLoader.initWebApplicationConte
35        at org.springframework.web.context.ContextLoaderListener.contextInitiali
36        at com.liferay.portal.spring.context.PortletContextLoaderListener.contex
37        at com.liferay.portal.kernel.servlet.PortalClassLoaderServletContextList
38        at com.liferay.portal.kernel.util.BasePortalLifecycle.portalInit(BasePor
39        at com.liferay.portal.kernel.util.PortalLifecycleUtil.register(PortalLif
40        at com.liferay.portal.kernel.util.PortalLifecycleUtil.register(PortalLif
41        at com.liferay.portal.kernel.util.BasePortalLifecycle.registerPortalLife
42        at com.liferay.portal.kernel.servlet.PortalClassLoaderServletContextList
43        at org.apache.catalina.core.StandardContext.listenerStart(StandardContex
44        at org.apache.catalina.core.StandardContext.startInternal(StandardContex
45        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
46        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase
47        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:84
48        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)
49        at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.jav
50
5107:16:04,354 ERROR [ContextLoader:227] Context initialization failed



Here is my tomcat\bin\setenv.sh

1JAVA_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
Alexander Chow
RE: LR 6.1 OutOfMemoryError: PermGen space
2012/01/24 6:16
答え

Alexander Chow

LIFERAY STAFF

ランク: Liferay Master

投稿: 519

参加年月日: 2005/07/19

最近の投稿

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
Nilesh Gundecha
RE: LR 6.1 OutOfMemoryError: PermGen space
2012/01/24 6:40
答え

Nilesh Gundecha

ランク: Regular Member

投稿: 194

参加年月日: 2009/11/30

最近の投稿

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.
Nilesh Gundecha
RE: LR 6.1 OutOfMemoryError: PermGen space
2012/02/01 23:33
答え

Nilesh Gundecha

ランク: Regular Member

投稿: 194

参加年月日: 2009/11/30

最近の投稿

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
Alexander Chow
RE: LR 6.1 OutOfMemoryError: PermGen space
2012/02/02 2:34
答え

Alexander Chow

LIFERAY STAFF

ランク: Liferay Master

投稿: 519

参加年月日: 2005/07/19

最近の投稿

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
Nilesh Gundecha
RE: LR 6.1 OutOfMemoryError: PermGen space
2012/02/02 3:11
答え

Nilesh Gundecha

ランク: Regular Member

投稿: 194

参加年月日: 2009/11/30

最近の投稿

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
Alexander Chow
RE: LR 6.1 OutOfMemoryError: PermGen space
2012/02/02 3:59
答え

Alexander Chow

LIFERAY STAFF

ランク: Liferay Master

投稿: 519

参加年月日: 2005/07/19

最近の投稿

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.
Olaf Kock
RE: LR 6.1 OutOfMemoryError: PermGen space
2012/02/05 3:34
答え

Olaf Kock

LIFERAY STAFF

ランク: Liferay Legend

投稿: 2245

参加年月日: 2008/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.
Jonathan Quach
RE: LR 6.1 OutOfMemoryError: PermGen space
2012/03/30 8:40
答え

Jonathan Quach

ランク: New Member

投稿: 1

参加年月日: 2012/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
David H Nebinger
RE: LR 6.1 OutOfMemoryError: PermGen space
2012/03/30 9:33
答え

David H Nebinger

Community Moderator

ランク: Liferay Legend

投稿: 8435

参加年月日: 2006/09/01

最近の投稿

Along same lines. Increase the amount of memory Liferay can use and try again.
Hitoshi Ozawa
RE: LR 6.1 OutOfMemoryError: PermGen space
2012/03/30 21:12
答え

Hitoshi Ozawa

ランク: Liferay Legend

投稿: 7952

参加年月日: 2010/03/23

最近の投稿

Alexander, it seems there is a memory leak in CE and not in EE.

http://www.liferay.com/community/forums/-/message_boards/message/13149294
Alexander Chow
RE: LR 6.1 OutOfMemoryError: PermGen space
2012/04/02 12:35
答え

Alexander Chow

LIFERAY STAFF

ランク: Liferay Master

投稿: 519

参加年月日: 2005/07/19

最近の投稿

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).
Wole Adetiba
RE: LR 6.1 OutOfMemoryError: PermGen space
2012/06/01 6:58
答え

Wole Adetiba

ランク: New Member

投稿: 10

参加年月日: 2007/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
Nilesh Gundecha
RE: LR 6.1 OutOfMemoryError: PermGen space
2012/06/01 23:17
答え

Nilesh Gundecha

ランク: Regular Member

投稿: 194

参加年月日: 2009/11/30

最近の投稿

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

1JAVA_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
Wole Adetiba
RE: LR 6.1 OutOfMemoryError: PermGen space
2012/06/04 2:07
答え

Wole Adetiba

ランク: New Member

投稿: 10

参加年月日: 2007/11/09

最近の投稿

Hi Nilesh,

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

Regards,

Wole
Olaf Kock
RE: LR 6.1 OutOfMemoryError: PermGen space
2012/06/05 8:16
答え

Olaf Kock

LIFERAY STAFF

ランク: Liferay Legend

投稿: 2245

参加年月日: 2008/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...
samuel tian
RE: LR 6.1 OutOfMemoryError: PermGen space
2012/06/14 2:10
答え

samuel tian

ランク: New Member

投稿: 5

参加年月日: 2012/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

1
209:01:11,842 INFO  [PortalImpl:4873] Current URL /poller/receive generates exception: null
309: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.
Olaf Kock
RE: LR 6.1 OutOfMemoryError: PermGen space
2012/06/14 4:49
答え

Olaf Kock

LIFERAY STAFF

ランク: Liferay Legend

投稿: 2245

参加年月日: 2008/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