稍微草拟问题:
我们正在为我们的网站使用liferay门户解决方案,并添加一些功能并修复我们在门户中使用方面的错误。它本身的方面数量在启动时不是问题,但是它们开始编织的类加载器的数量是。
Liferay使用JRuby对CSS文件执行SASS评估。每个被处理的CSS文件都会获得它自己的jruby类加载器(我对jruby的了解有限,所以我不知道它是否应该工作的方式)。这导致如果同时执行很多css / jruby动作,则内存可以跳跃1.5GB并使JVM耗尽内存。如果JVM在此初始跳转中幸存,或者如果没有同时处理多个文件,则内存使用会在一段时间后恢复正常。因此问题显然是由编织过程的内存开销引起的
在尝试寻找解决方案时,我想出了一些可以做的改变。但我不确定哪个更好,如果有一些选择甚至可能。
答案 0 :(得分:0)
我很确定aop.xml文件中的配置是可行的方法。请参阅https://www.eclipse.org/aspectj/doc/next/devguide/ltw-configuration.html您将需要使用排除选项。
文档中的一个例子:
<weaver options="-verbose">
<!-- Weave types that are within the javax.* or org.aspectj.*
packages. Also weave all types in the foo package that do
not have the @NoWeave annotation. -->
<include within="javax.*"/>
<include within="org.aspectj.*"/>
<include within="(!@NoWeave foo.*) AND foo.*"/>
<!-- Do not weave types within the "bar" pakage -->
<exclude within="bar.*"/>
<!-- Dump all types within the "somepack" package,
both before are after they are woven,
to the "./_ajdump" folder on disk (for diagnostic purposes) -->
<dump within="somepack.*" />
</weaver>
答案 1 :(得分:0)
对于谁可能需要1.答案的问题是,可以使用aj.weaving.loadersToSkip
参数跳过类加载器。您需要将此参数作为vm参数传递。
例如:
-Daj.weaving.loadersToSkip=weblogic.utils.classloaders.GenericClassLoader