Vista combinada Visión Plana Vista de árbol
Discusiones [ Anterior | Siguiente ]
toggle
donino pienni
Severe memory leaks with JRuby
28 de septiembre de 2012 3:53
Respuesta

donino pienni

Ranking: Junior Member

Mensajes: 82

Fecha de incorporación: 2 de julio de 2011

Mensajes recientes

Hi,

I use Liferay 6.1.1.GA2 with tomcat 7, 1Gb heap memory on a 32 Bits Sun JVM..

I encounter a critical memory leak in my context., after 2 or 3 days i run out of memory. Heap dumps show it is mainly due to JRuby. For example after only one day up:



And the relevant "dominator tree" shows JRuby is using more than 200Mb. This JRuby memory usage is growing and growing until an OutOfMemory :



I found this issue has already been reported in JIRA one year ago as /LPS-22464. It seems Liferay is only using JRuby to parse CSS files. I suspect it happens when pretty large css files are included in a liferay-portlet.xml descriptor. A workaround may be to include CSS in the theme rather in portlets, but in my context it is not so that simple.

Is there any option to disable JRuby in Liferay? Does anyone have further informations about this issue?

Thanks!
donino pienni
RE: Memory leaks with JRuby
10 de octubre de 2012 0:42
Respuesta

donino pienni

Ranking: Junior Member

Mensajes: 82

Fecha de incorporación: 2 de julio de 2011

Mensajes recientes

Hi,

It appears my workaround is not sufficient: JRuby,'s memory usage is rising much slowier, but it is still rising until an OutOfMemory. Please does someone know in which classes JRuby is used, so that i try to fix this? Is it only used to parse SASS files? Does it process css included in a theme, or only css included in a liferay-portlet.xml file? Is there a cache involved in this SASS parsing process, and a Liferay parameter to limit it?

Thanks
Riccardo Ferrari
RE: Memory leaks with JRuby
24 de octubre de 2012 12:03
Respuesta

Riccardo Ferrari

Ranking: Regular Member

Mensajes: 137

Fecha de incorporación: 13 de noviembre de 2010

Mensajes recientes

Hi Donino,

Can you try to add the following option to your JVM arguments:
-Djruby.min.runtimes=1
-Djruby.max.runtimes=1

Hope it helps,
Riccardo
Hitoshi Ozawa
RE: Memory leaks with JRuby
24 de octubre de 2012 14:49
Respuesta

Hitoshi Ozawa

Ranking: Liferay Legend

Mensajes: 7949

Fecha de incorporación: 23 de marzo de 2010

Mensajes recientes

Liferay is using sass (http://sass-lang.com/) to process css. Sass is written in Ruby and Liferay is using jruby so it will run.
It appears if you have css in hooks, it'll use sass.

I can't say for sure without looking at your system, but it maybe a problem with your css. Check if you have any custom css and try removing it to see if memory leakage problem remains.
donino pienni
RE: Memory leaks with JRuby
25 de octubre de 2012 2:06
Respuesta

donino pienni

Ranking: Junior Member

Mensajes: 82

Fecha de incorporación: 2 de julio de 2011

Mensajes recientes

Riccardo Ferrari:
Hi Donino,

Can you try to add the following option to your JVM arguments:
-Djruby.min.runtimes=1
-Djruby.max.runtimes=1

Hope it helps,
Riccardo


Riccardo, thank you for your response, i have just restarted my server with the arguments you suggested. I will post if it improves the Jruby memory issue in my context.
donino pienni
RE: Memory leaks with JRuby
25 de octubre de 2012 2:44
Respuesta

donino pienni

Ranking: Junior Member

Mensajes: 82

Fecha de incorporación: 2 de julio de 2011

Mensajes recientes

Hitoshi Ozawa:
Liferay is using sass (http://sass-lang.com/) to process css. Sass is written in Ruby and Liferay is using jruby so it will run.
It appears if you have css in hooks, it'll use sass.

I can't say for sure without looking at your system, but it maybe a problem with your css. Check if you have any custom css and try removing it to see if memory leakage problem remains.


Thank your for your response Hitoshi,

I removed all my custom CSS (mainly a jQuery themeroller) from liferay-portlet.xml descriptors, and included them in a JSP page instead. Thus they seem to be kept out of reach of Jruby. It is much better: previously it i lost about 100 Mb per day due to Jruby, now with a better frequentation i loose only 5Mb per day. So now i only need to restart Liferay once a month. Before restarting my server to apply the arguments suggested above by Riccardo , i analyzed a heap dump with Eclipse MAT, the leak seems entirely due to jRuby, though it should not process any custom CSS anymore. I even tried to remove all CSS files from the knowledge base portlet, but i still have this issue.

In a common Liferay server install, how much max memory Jruby is supposed to consume permanently? Do you currently use a 6.1+ CE version, without any memory issue?

Thanks
Hitoshi Ozawa
RE: Memory leaks with JRuby
25 de octubre de 2012 6:44
Respuesta

Hitoshi Ozawa

Ranking: Liferay Legend

Mensajes: 7949

Fecha de incorporación: 23 de marzo de 2010

Mensajes recientes

JRuby 1.7.0 release Oct 22, 2012 seems to have fixed several memory leak problems.

Another option that is going to require more work is to replace sass so jruby won't be required.
Vedran Pugar
RE: Memory leaks with JRuby
16 de mayo de 2013 13:05
Respuesta

Vedran Pugar

Ranking: Junior Member

Mensajes: 26

Fecha de incorporación: 10 de febrero de 2006

Mensajes recientes

To remove jruby from version 6.1.1 with tomcat:

- remove jruby.jar from webapps/ROOT/WEB-INF/lib

- set scripting.jruby.compile.mode=off

- comment out in scripting-spring.xml:
1<!-- entry key="ruby">
2<bean class="com.liferay.portal.scripting.ruby.RubyExecutor" />
3</entry -->


- from com.liferay.portal.servlet.filters.dynamiccss.DynamicCSSUtil remove any all ruby import
Replace
1parsedContent = _parseSass(
2request, themeDisplay, theme, cssRealPath, content);


to

1if (cacheCssRealFile.exists()) {
2     parsedContent = FileUtil.read(cacheCssRealFile);
3} else {
4_log.warn("This is implementation without jruby, please provide cache css file " + cacheCssRealFile);
5}

Remove method _parseSass.


Please note: if you remove jruby.jar from liferay web application your theme build will not work if you use web application for sdk build configuration. Also last code replacement expects that there is css cache file already build in theme. After changing scripting-spring.xml there will be not available ruby scripting.
donino pienni
RE: Memory leaks with JRuby
2 de junio de 2013 1:31
Respuesta

donino pienni

Ranking: Junior Member

Mensajes: 82

Fecha de incorporación: 2 de julio de 2011

Mensajes recientes

Thank you for this workaround Vedran, it worked for me! I hope the Liferay team will take this jruby issue into consideration in the next release emoticon
Niall O'Grady
RE: Memory leaks with JRuby
11 de octubre de 2013 6:26
Respuesta

Niall O'Grady

Ranking: New Member

Mensajes: 7

Fecha de incorporación: 15 de enero de 2013

Mensajes recientes

Hello All,

We have been experiencing issues which seem closely related to those mentioned in this thread. I would be interested to know if other continue to experience JRuby memory usage issues.

Our environment includes:
Portal v 6.1.2
Tomcat 7
Windows OS
MS SQL back-end

Our issue is:
Severe production server instability. 2 ~ 3 day uptime before the memory usage bumps up against the 4gb heap ceiling.
A heap dump when the server is in this unusable state shows 20% ~ 30% JRuby memory usage

What have we tried:
1. Moved as much CSS to the theme as is possible at this time

2. Added the following to your JVM arguments per recommendation in this thread
-Djruby.min.runtimes=1
-Djruby.max.runtimes=1

3. JRuby upgrade to v1.7.4

4. I attended Berlin DevCon (what a fantastic event!) in recent days and lucky enough to get chatting to some of the Liferay escalations engineers who recommended that I check that the .saas-cache dir is created in the deployed WAR (it is) and that the files within that dir have an identical name and timestamp as those in the css dir (it is).

5. It was confirmed to me at DevCon that the Saas compilation should only run at build time. In our situation it clearly is not.

Any suggestions would be most welcome.

Niall O'Grady
donino pienni
RE: Memory leaks with JRuby
6 de diciembre de 2013 5:44
Respuesta

donino pienni

Ranking: Junior Member

Mensajes: 82

Fecha de incorporación: 2 de julio de 2011

Mensajes recientes

Hi,

I am not entirely sure yet, but with Liferay 6.2 it seems the problem is now solved. We only have 1.1Gb heap memory, and after 8 days without restart the memory consumption is stable around 53%, with a good frequentation! With Liferay 6.1 and jruby enabled, it was necessary to schedule a restart every 2 days to prevent OutOfMemory emoticon
Niall O'Grady
RE: Memory leaks with JRuby
9 de diciembre de 2013 1:57
Respuesta

Niall O'Grady

Ranking: New Member

Mensajes: 7

Fecha de incorporación: 15 de enero de 2013

Mensajes recientes

Hi Donino,

Thanks for your comment.

I am pleased report that (with significant help from Liferay Support) we have managed to resolve the issue of JRuby presence in our heap.

The actions we took to resolve this were:
- Ensuring that the timestamp associated with the .sass-cache version of all CSS entries was exactly in sync (the the millisecond) with the non .sass-cache version of the file. Liferay Support provided us with a script to resolve any inconsistencies.

- We had some hooks with CSS overrides in them. We changed that

- The biggest difference we saw was when we deleted the \meta-inf\context.xml file from each plugin. At deploy time this file is generated to include two entries, none of which are necessary, one of which is potentially damaging it would seem. Once we cleared out these files there wasn't a trace of JRuby in the heap.

If anybody needs more information on the specifics on the steps we took, or who within Liferay support we dealt with, please let me know.

Thanks,
Niall O'Grady
Srilalitha Pusuluri
RE: Memory leaks with JRuby
17 de enero de 2014 8:24
Respuesta

Srilalitha Pusuluri

Ranking: New Member

Mensajes: 11

Fecha de incorporación: 24 de febrero de 2012

Mensajes recientes

Niall ,

I am using 6.2 EE . My custom theme is based on _unstyled theme. I am still getting PermGen Errors from Ruby. Any suggestions ?

java.lang.OutOfMemoryError: PermGen space
16:13:58,779 ERROR [MemoryQuartzSchedulerEngineInstance_Worker-4][ErrorLogger:120] Job (com.liferay.portal.deploy.messaging.RequiredPluginsMessageListener.com.liferay.portal.deploy.messaging.RequiredPluginsMessageListener threw an exception.
org.quartz.SchedulerException: Job threw an unhandled exception. [See nested exception: java.lang.OutOfMemoryError: PermGen space]
at org.quartz.core.JobRunShell.run(JobRunShell.java:224)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:557)
Caused by: java.lang.OutOfMemoryError: PermGen space
16:13:58,779 INFO [com.liferay.portal.kernel.deploy.auto.AutoDeployScanner][AutoDeployDir:204] Processing JHU_Basic_New-theme-6.2.10.1.war
16:13:45,174 ERROR [MemoryQuartzSchedulerEngineInstance_Worker-5][JobRunShell:120] Job com.liferay.calendar.messaging.CheckBookingsMessageListener.com.liferay.calendar.messaging.CheckBookingsMessageListener threw an unhandled Exception:
java.lang.OutOfMemoryError: PermGen space
16:14:12,486 ERROR [MemoryQuartzSchedulerEngineInstance_Worker-5][ErrorLogger:120] Job (com.liferay.calendar.messaging.CheckBookingsMessageListener.com.liferay.calendar.messaging.CheckBookingsMessageListener threw an exception.
org.quartz.SchedulerException: Job threw an unhandled exception. [See nested exception: java.lang.OutOfMemoryError: PermGen space]
at org.quartz.core.JobRunShell.run(JobRunShell.java:224)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:557)
Caused by: java.lang.OutOfMemoryError: PermGen space
16:14:10,564 ERROR [http-bio-8080-exec-133][DynamicCSSFilter:177] Unable to parse SASS on CSS /css/layout.css
com.liferay.portal.kernel.scripting.ScriptingException: java.util.concurrent.ExecutionException: org.jruby.embed.EvalFailedException: java.lang.OutOfMemoryError: PermGen space
at com.liferay.portal.scripting.ruby.RubyExecutor.eval(RubyExecutor.java:254)
at com.liferay.portal.scripting.ruby.RubyExecutor.eval(RubyExecutor.java:129)
at com.liferay.portal.servlet.filters.dynamiccss.DynamicCSSUtil._parseSass(DynamicCSSUtil.java:391)
at com.liferay.portal.servlet.filters.dynamiccss.DynamicCSSUtil.parseSass(DynamicCSSUtil.java:161)
at com.liferay.portal.servlet.filters.dynamiccss.DynamicCSSFilter.getDynamicContent(DynamicCSSFilter.java:142)
at com.liferay.portal.servlet.filters.dynamiccss.DynamicCSSFilter.processFilter(DynamicCSSFilter.java:204)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:59)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:204)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109)
at com.liferay.portal.kernel.servlet.PortalClassLoaderFilter.doFilter(PortalClassLoaderFilter.java:74)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:204)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109)
at sun.reflect.GeneratedMethodAccessor1427.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.liferay.portal.kernel.bean.ClassLoaderBeanHandler.invoke(ClassLoaderBeanHandler.java:67)
at $Proxy541.doFilter(Unknown Source)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:169)
at com.liferay.portal.servlet.filters.aggregate.AggregateFilter.processFilter(AggregateFilter.java:515)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:59)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:204)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109)
at com.liferay.portal.kernel.servlet.PortalClassLoaderFilter.doFilter(PortalClassLoaderFilter.java:74)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:204)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109)
at sun.reflect.GeneratedMethodAccessor1427.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.liferay.portal.kernel.bean.ClassLoaderBeanHandler.invoke(ClassLoaderBeanHandler.java:67)
at $Proxy541.doFilter(Unknown Source)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:169)
at com.liferay.portal.servlet.filters.gzip.GZipFilter.processFilter(GZipFilter.java:123)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:59)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:204)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109)
at com.liferay.portal.kernel.servlet.PortalClassLoaderFilter.doFilter(PortalClassLoaderFilter.java:74)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:204)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.liferay.portal.kernel.bean.ClassLoaderBeanHandler.invoke(ClassLoaderBeanHandler.java:67)
at $Proxy541.doFilter(Unknown Source)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:165)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:96)
at com.liferay.portal.kernel.servlet.PortalClassLoaderFilter.doFilter(PortalClassLoaderFilter.java:74)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:204)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.util.concurrent.ExecutionException: org.jruby.embed.EvalFailedException: java.lang.OutOfMemoryError: PermGen space
at java.util.concurrent.FutureTask$Sync.innerGet(Unknown Source)
at java.util.concurrent.FutureTask.get(Unknown Source)
at com.liferay.portal.scripting.ruby.RubyExecutor.eval(RubyExecutor.java:248)
... 68 more
Caused by: org.jruby.embed.EvalFailedException: java.lang.OutOfMemoryError: PermGen space
at org.jruby.embed.internal.EmbedEvalUnitImpl.run(EmbedEvalUnitImpl.java:141)
at org.jruby.embed.ScriptingContainer.runUnit(ScriptingContainer.java:1231)
at org.jruby.embed.ScriptingContainer.runScriptlet(ScriptingContainer.java:1224)
at com.liferay.portal.scripting.ruby.RubyExecutor.doEval(RubyExecutor.java:189)
at com.liferay.portal.scripting.ruby.RubyExecutor$EvalCallable.call(RubyExecutor.java:332)
at com.liferay.portal.scripting.ruby.RubyExecutor$EvalCallable.call(RubyExecutor.java:1)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
... 1 more
Caused by: java.lang.OutOfMemoryError: PermGen space
16:14:10,563 ERROR [http-bio-8080-exec-138][DynamicCSSFilter:177] Unable to parse SASS on CSS /css/theme_custom.css
com.liferay.portal.kernel.scripting.ScriptingException: java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: PermGen space
at com.liferay.portal.scripting.ruby.RubyExecutor.eval(RubyExecutor.java:254)
at com.liferay.portal.scripting.ruby.RubyExecutor.eval(RubyExecutor.java:129)
at com.liferay.portal.servlet.filters.dynamiccss.DynamicCSSUtil._parseSass(DynamicCSSUtil.java:391)
at com.liferay.portal.servlet.filters.dynamiccss.DynamicCSSUtil.parseSass(DynamicCSSUtil.java:161)
at com.liferay.portal.servlet.filters.dynamiccss.DynamicCSSFilter.getDynamicContent(DynamicCSSFilter.java:142)
at com.liferay.portal.servlet.filters.dynamiccss.DynamicCSSFilter.processFilter(DynamicCSSFilter.java:204)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:59)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:204)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109)
at com.liferay.portal.kernel.servlet.PortalClassLoaderFilter.doFilter(PortalClassLoaderFilter.java:74)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:204)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109)
at sun.reflect.GeneratedMethodAccessor1428.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.liferay.portal.kernel.bean.ClassLoaderBeanHandler.invoke(ClassLoaderBeanHandler.java:67)
at $Proxy541.doFilter(Unknown Source)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:169)
at com.liferay.portal.servlet.filters.aggregate.AggregateFilter.processFilter(AggregateFilter.java:515)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:59)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:204)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109)
at com.liferay.portal.kernel.servlet.PortalClassLoaderFilter.doFilter(PortalClassLoaderFilter.java:74)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:204)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109)
at sun.reflect.GeneratedMethodAccessor1428.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.liferay.portal.kernel.bean.ClassLoaderBeanHandler.invoke(ClassLoaderBeanHandler.java:67)
at $Proxy541.doFilter(Unknown Source)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:169)
at com.liferay.portal.servlet.filters.gzip.GZipFilter.processFilter(GZipFilter.java:123)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:59)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:204)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109)
at com.liferay.portal.kernel.servlet.PortalClassLoaderFilter.doFilter(PortalClassLoaderFilter.java:74)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:204)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109)
at sun.reflect.GeneratedMethodAccessor1428.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.liferay.portal.kernel.bean.ClassLoaderBeanHandler.invoke(ClassLoaderBeanHandler.java:67)
at $Proxy541.doFilter(Unknown Source)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:165)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:96)
at com.liferay.portal.kernel.servlet.PortalClassLoaderFilter.doFilter(PortalClassLoaderFilter.java:74)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:204)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: PermGen space
at java.util.concurrent.FutureTask$Sync.innerGet(Unknown Source)
at java.util.concurrent.FutureTask.get(Unknown Source)
at com.liferay.portal.scripting.ruby.RubyExecutor.eval(RubyExecutor.java:248)
... 67 more
Caused by: java.lang.OutOfMemoryError: PermGen space
16:13:58,780 ERROR [http-bio-8080-exec-141][DynamicCSSFilter:177] Unable to parse SASS on CSS /css/portlet.css
com.liferay.portal.kernel.scripting.ScriptingException: java.util.concurrent.ExecutionException: org.jruby.embed.EvalFailedException: java.lang.OutOfMemoryError: PermGen space
at com.liferay.portal.scripting.ruby.RubyExecutor.eval(RubyExecutor.java:254)
at com.liferay.portal.scripting.ruby.RubyExecutor.eval(RubyExecutor.java:129)
at com.liferay.portal.servlet.filters.dynamiccss.DynamicCSSUtil._parseSass(DynamicCSSUtil.java:391)
at com.liferay.portal.servlet.filters.dynamiccss.DynamicCSSUtil.parseSass(DynamicCSSUtil.java:161)
at com.liferay.portal.servlet.filters.dynamiccss.DynamicCSSFilter.getDynamicContent(DynamicCSSFilter.java:142)
at com.liferay.portal.servlet.filters.dynamiccss.DynamicCSSFilter.processFilter(DynamicCSSFilter.java:204)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:59)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:204)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109)
at com.liferay.portal.kernel.servlet.PortalClassLoaderFilter.doFilter(PortalClassLoaderFilter.java:74)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:204)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109)
at sun.reflect.GeneratedMethodAccessor1425.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.liferay.portal.kernel.bean.ClassLoaderBeanHandler.invoke(ClassLoaderBeanHandler.java:67)
at $Proxy541.doFilter(Unknown Source)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:169)
at com.liferay.portal.servlet.filters.aggregate.AggregateFilter.processFilter(AggregateFilter.java:515)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:59)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:204)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109)
at com.liferay.portal.kernel.servlet.PortalClassLoaderFilter.doFilter(PortalClassLoaderFilter.java:74)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:204)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109)
at sun.reflect.GeneratedMethodAccessor1425.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.liferay.portal.kernel.bean.ClassLoaderBeanHandler.invoke(ClassLoaderBeanHandler.java:67)
at $Proxy541.doFilter(Unknown Source)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:169)
at com.liferay.portal.servlet.filters.gzip.GZipFilter.processFilter(GZipFilter.java:123)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:59)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:204)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109)
at com.liferay.portal.kernel.servlet.PortalClassLoaderFilter.doFilter(PortalClassLoaderFilter.java:74)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:204)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.liferay.portal.kernel.bean.ClassLoaderBeanHandler.invoke(ClassLoaderBeanHandler.java:67)
at $Proxy541.doFilter(Unknown Source)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:165)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:96)
at com.liferay.portal.kernel.servlet.PortalClassLoaderFilter.doFilter(PortalClassLoaderFilter.java:74)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:204)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.util.concurrent.ExecutionException: org.jruby.embed.EvalFailedException: java.lang.OutOfMemoryError: PermGen space
at java.util.concurrent.FutureTask$Sync.innerGet(Unknown Source)
at java.util.concurrent.FutureTask.get(Unknown Source)
at com.liferay.portal.scripting.ruby.RubyExecutor.eval(RubyExecutor.java:248)
... 68 more
Caused by: org.jruby.embed.EvalFailedException: java.lang.OutOfMemoryError: PermGen space
at org.jruby.embed.internal.EmbedEvalUnitImpl.run(EmbedEvalUnitImpl.java:141)
at org.jruby.embed.ScriptingContainer.runUnit(ScriptingContainer.java:1231)
at org.jruby.embed.ScriptingContainer.runScriptlet(ScriptingContainer.java:1224)
at com.liferay.portal.scripting.ruby.RubyExecutor.doEval(RubyExecutor.java:189)
at com.liferay.portal.scripting.ruby.RubyExecutor$EvalCallable.call(RubyExecutor.java:332)
at com.liferay.portal.scripting.ruby.RubyExecutor$EvalCallable.call(RubyExecutor.java:1)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
... 1 more
Caused by: java.lang.OutOfMemoryError: PermGen space
Niall O'Grady
RE: Memory leaks with JRuby
17 de enero de 2014 8:52
Respuesta

Niall O'Grady

Ranking: New Member

Mensajes: 7

Fecha de incorporación: 15 de enero de 2013

Mensajes recientes

Hello Srilalitha,

The issues we experienced with JRuby consuming all available memory may have been different to what you have reported in your stacktrace. I don't recall us having seen specific references to jruby on our server console, rather we identified JRuby as a leak suspect from performing a memory analysis of the heap after a heapdump was generated. As mentioned in my earlier comments, I recall these steps as having contributed to our issue being resolved:

- Ensuring that the timestamp associated with the .sass-cache version of all CSS entries was exactly in sync (the the millisecond) with the non .sass-cache version of the file. Liferay Support provided us with a script to resolve any inconsistencies.

- We had some hooks with CSS overrides in them. We changed that

- The biggest difference we saw was when we deleted the \meta-inf\context.xml file from each plugin. At deploy time this file is generated to include two entries, none of which are necessary, one of which is potentially damaging it would seem. Once we cleared out these files there wasn't a trace of JRuby in the heap.

If you have a heap dump or can generate one when the server is in a distressed state we always found that to be useful. A memory analyzer tool can then point you to what is chewing up all your memory.

Hope this helps.
Niall
Srilalitha Pusuluri
RE: Memory leaks with JRuby
17 de enero de 2014 9:04
Respuesta

Srilalitha Pusuluri

Ranking: New Member

Mensajes: 11

Fecha de incorporación: 24 de febrero de 2012

Mensajes recientes

Niall,

We did have the heap dump and examined in a memory leak analyser. Found that it is the Ruby engine that is has the memory leak. It was there in 6.1 too. Then we were waiting it to be fixed. Also from our side we did not use any SCSS to avoid ruby engine. But with the new themes I noticed that a lot of SCSS is being used in the basic themes such as _unstyled. when I build my theme these files are being inherited. a few example are :

_aui_custom.scss
_liferay_custom.scss
_aui_variables.scss
/aui/....scss files.

Thanks,
Srilalitha
Srinivas KK
RE: Memory leaks with JRuby
18 de enero de 2014 6:38
Respuesta

Srinivas KK

Ranking: Junior Member

Mensajes: 33

Fecha de incorporación: 3 de diciembre de 2011

Mensajes recientes

We had this issue , when fast load is turned on and liferay merges css at runtime.
So, i simply moved generated main.css to cdn and updated top-head/?.jsp to refer this main.css . No more jruby errors.
Srilalitha Pusuluri
RE: Memory leaks with JRuby
23 de enero de 2014 7:40
Respuesta

Srilalitha Pusuluri

Ranking: New Member

Mensajes: 11

Fecha de incorporación: 24 de febrero de 2012

Mensajes recientes

Srinivas ,
this might work in the local dev environment. But for production ? every time there is a css change after I deploy I need to manually move the main.css to css dir. this does not work for production environment.
Liferay need to fix the memory leak issue.

To reproduce the issue , create a theme based on one of life ray themes such as _unstyled . keep making minor changes and deploy the changes. do this a several times. you will perm gen errors.
Srinivas KK
RE: Memory leaks with JRuby
23 de enero de 2014 19:49
Respuesta

Srinivas KK

Ranking: Junior Member

Mensajes: 33

Fecha de incorporación: 3 de diciembre de 2011

Mensajes recientes

If your custom css stays outside theme , this solution works. In this case main.css contains only liferay css.
good luck with the fix.
Kurt Xu
RE: Memory leaks with JRuby
16 de abril de 2014 2:49
Respuesta

Kurt Xu

Ranking: Junior Member

Mensajes: 57

Fecha de incorporación: 2 de febrero de 2013

Mensajes recientes

Vedran Pugar:
To remove jruby from version 6.1.1 with tomcat:

- remove jruby.jar from webapps/ROOT/WEB-INF/lib

- set scripting.jruby.compile.mode=off

- comment out in scripting-spring.xml:
1<!-- entry key="ruby">
2<bean class="com.liferay.portal.scripting.ruby.RubyExecutor" />
3</entry -->


- from com.liferay.portal.servlet.filters.dynamiccss.DynamicCSSUtil remove any all ruby import
Replace
1parsedContent = _parseSass(
2request, themeDisplay, theme, cssRealPath, content);


to

1if (cacheCssRealFile.exists()) {
2     parsedContent = FileUtil.read(cacheCssRealFile);
3} else {
4_log.warn("This is implementation without jruby, please provide cache css file " + cacheCssRealFile);
5}

Remove method _parseSass.


Please note: if you remove jruby.jar from liferay web application your theme build will not work if you use web application for sdk build configuration. Also last code replacement expects that there is css cache file already build in theme. After changing scripting-spring.xml there will be not available ruby scripting.


Hello Vedran:
I did as you said, but some portlets wouldn't work, saying below error message:

Status
Internal Server Error

An error occurred while accessing the requested resource.

http://localhost:8080/en/web/guest/haier-index


Don't know if -Djruby.min.runtimes=1 and -Djruby.max.runtimes=1 can make the same effect as your method.

Thanks.
Kurt
Virginia Calderón
RE: Memory leaks with JRuby
13 de agosto de 2015 5:30
Respuesta

Virginia Calderón

Ranking: New Member

Mensajes: 7

Fecha de incorporación: 24 de marzo de 2011

Mensajes recientes

Hello Niall,

¿Could you fix this problem in your portal?

We have changed these options but we haven’t found improvements:
  1. scripting.jruby.compile.mode=off
  2. Djruby.min.runtimes=1 -Djruby.max.runtimes=1
  3. Update jruby.jar from 1.5.0_19 to JRuby 1.7.21


Thank you very much,