编译时编织时出现内存不足错误。如您所见,我已经将 Xmx(通过 maxmem)设置为 1024m。这可能是由于我尝试编织的 jar 约为 70MB。
如何设置垃圾收集器?我尝试使用 X 参数,但是当我使用 JConsole 连接到进程时,未设置 ConcMarkSweep。
<echo message="Weaving..."/>
<aspectj:iajc classpathref="compile.libs" aspectpath="${src.dir}" outJar="${output.jar}" fork="true" maxmem="1024m" X="+UseConcMarkSweepGC">
<inpath>
<pathelement path="${classes.dir}"/>
</inpath>
</aspectj:iajc>
错误是:
Bugs for exceptions thrown have titles File:line from the top stack,
e.g., "SomeFile.java:243"
If you don't find the exception below in a bug, please add a new bug
at http://bugs.eclipse.org/bugs/enter_bug.cgi?product=AspectJ
To make the bug a priority, please include a test program
that can reproduce this exception.
GC overhead limit exceeded
when weaving classes
when weaving
when batch building BuildConfig[null] #Files=0 AopXmls=#0
GC overhead limit exceeded
java.lang.OutOfMemoryError: GC overhead limit exceeded
at org.aspectj.apache.bcel.classfile.ConstantPool.copy(ConstantPool.java:69)
at org.aspectj.apache.bcel.generic.ClassGen.<init>(ClassGen.java:161)
at org.aspectj.weaver.bcel.LazyClassGen.<init>(LazyClassGen.java:255)
at org.aspectj.weaver.bcel.BcelObjectType.getLazyClassGen(BcelObjectType.java:523)
at org.aspectj.weaver.bcel.BcelWeaver.weave(BcelWeaver.java:1742)
at org.aspectj.weaver.bcel.BcelWeaver.weaveWithoutDump(BcelWeaver.java:1710)
at org.aspectj.weaver.bcel.BcelWeaver.weaveAndNotify(BcelWeaver.java:1472)
at org.aspectj.weaver.bcel.BcelWeaver.weave(BcelWeaver.java:1286)
at org.aspectj.ajdt.internal.compiler.AjPipeliningCompilerAdapter.weaveQueuedEntries(AjPipeliningCompilerAdapter.java:435)
at org.aspectj.ajdt.internal.compiler.AjPipeliningCompilerAdapter.afterCompiling(AjPipeliningCompilerAdapter.java:304)
at org.aspectj.ajdt.internal.compiler.CompilerAdapter.ajc$afterReturning$org_aspectj_ajdt_internal_compiler_CompilerAdapter$2$f9cc9ca0(CompilerAdapter.aj:73)
at org.aspectj.org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:430)
at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performCompilation(AjBuildManager.java:1003)
at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performBuild(AjBuildManager.java:267)
at org.aspectj.ajdt.internal.core.builder.AjBuildManager.batchBuild(AjBuildManager.java:181)
at org.aspectj.ajdt.ajc.AjdtCommand.doCommand(AjdtCommand.java:112)
at org.aspectj.ajdt.ajc.AjdtCommand.runCommand(AjdtCommand.java:60)
at org.aspectj.tools.ajc.Main.run(Main.java:355)
at org.aspectj.tools.ajc.Main.runMain(Main.java:234)
at org.aspectj.tools.ajc.Main.main(Main.java:84)
23-Sep-2013 23:58:12 org.aspectj.weaver.tools.Jdk14Trace info
INFO: Dumping to D:\Projects\Delete\AspectjTest\.\ajcore.20130923.234357.932.txt
1 fail|abort