AspectJ - Out of memory or internal error...

I'm trying out the official AspectJ support (1.0) within IntelliJ 10.5 without much luck.

On a tiny proof of concept project, it works. A single file in a larger project may also work.

A set of 10 files within a large project takes a couple of minutes and then fails with the "ran out of memory during compilation" error, even though the Maximum heap size of the compiler is set far above what is needed by the Ajc ant task.

If I increase the heap size further (2048 MB for testing) I get "Error: Compiler internal error. Process termintaed with error code 1" and this stacktrace in the log:

2011-07-12 11:12:37,038 [  71845]  DEBUG - ij.compiler.impl.CompileDriver -
com.intellij.compiler.impl.CompileDriver$ExitException
    at com.intellij.compiler.impl.CompileDriver.a(CompileDriver.java:1236)
    at com.intellij.compiler.impl.CompileDriver.a(CompileDriver.java:768)
    at com.intellij.compiler.impl.CompileDriver.a(CompileDriver.java:509)
    at com.intellij.compiler.impl.CompileDriver.access$700(CompileDriver.java:92)
    at com.intellij.compiler.impl.CompileDriver$6.run(CompileDriver.java:451)
    at com.intellij.compiler.progress.CompilerTask.run(CompilerTask.java:155)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl$TaskRunnable.run(ProgressManagerImpl.java:464)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl$2.run(ProgressManagerImpl.java:181)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:209)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcess(ProgressManagerImpl.java:172)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl$6.run(ProgressManagerImpl.java:340)
    at com.intellij.openapi.application.impl.ApplicationImpl$6.run(ApplicationImpl.java:375)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:662)
    at com.intellij.openapi.application.impl.ApplicationImpl$1$1.run(ApplicationImpl.java:130)
2011-07-12 11:12:37,039 [  71846]  DEBUG - ij.compiler.impl.CompileDriver - Errors reported:
2011-07-12 11:12:37,039 [  71846]  DEBUG - ij.compiler.impl.CompileDriver -     Compiler internal error. Process terminated with exit code 1



Is there anything I could do to make this work, or at least get more info about the error...?

AspectJ version in use is 1.6.10.


For reference: http://devnet.jetbrains.net/message/5272370
4 comments
Comment actions Permalink

Hi Mattias,

you can enable addional logging as per here: http://devnet.jetbrains.net/message/5307825#5307825

Current design of Ajc compiler in IDEA provides the whole copy of classpath as an aspectpath - this allows to avoid extra configuration, but causes slowliness and increased memory consumption on a reasonable-sized projects. Precise aspectpath configuration UI is planned for IDEA 11.

0
Comment actions Permalink

Part of the log is below. It seems the way the plugin calls AspectJ triggers a problem internally within AspectJ.
The command line for the compiler call is awfully long (like 190'000 characters) and seems to explicitly pass every single source file, even on Rebuild project. That might explain the problem - but not how to solve it.

2011-07-12 16:19:19,856 [ 467063]  DEBUG - pectj.compiler.ajc.AjcCompiler - ajc: Exception thrown from AspectJ 1.6.11
2011-07-12 16:19:19,856 [ 467063]  DEBUG - pectj.compiler.ajc.AjcCompiler - ajc:  
2011-07-12 16:19:19,856 [ 467063]  DEBUG - pectj.compiler.ajc.AjcCompiler - ajc: This might be logged as a bug already -- find current bugs at
2011-07-12 16:19:19,856 [ 467063]  DEBUG - pectj.compiler.ajc.AjcCompiler - ajc:   http://bugs.eclipse.org/bugs/buglist.cgi?product=AspectJ&component=Compiler
2011-07-12 16:19:19,856 [ 467063]  DEBUG - pectj.compiler.ajc.AjcCompiler - ajc:  
2011-07-12 16:19:19,856 [ 467063]  DEBUG - pectj.compiler.ajc.AjcCompiler - ajc: Bugs for exceptions thrown have titles File:line from the top stack,  
2011-07-12 16:19:19,856 [ 467063]  DEBUG - pectj.compiler.ajc.AjcCompiler - ajc: e.g., "SomeFile.java:243"
2011-07-12 16:19:19,856 [ 467063]  DEBUG - pectj.compiler.ajc.AjcCompiler - ajc:  
2011-07-12 16:19:19,856 [ 467063]  DEBUG - pectj.compiler.ajc.AjcCompiler - ajc: If you don't find the exception below in a bug, please add a new bug
2011-07-12 16:19:19,856 [ 467063]  DEBUG - pectj.compiler.ajc.AjcCompiler - ajc: at http://bugs.eclipse.org/bugs/enter_bug.cgi?product=AspectJ
2011-07-12 16:19:19,856 [ 467063]  DEBUG - pectj.compiler.ajc.AjcCompiler - ajc: To make the bug a priority, please include a test program
2011-07-12 16:19:19,856 [ 467063]  DEBUG - pectj.compiler.ajc.AjcCompiler - ajc: that can reproduce this exception.
2011-07-12 16:19:19,857 [ 467064]  DEBUG - pectj.compiler.ajc.AjcCompiler - ajc: Problem processing attributes in org/aspectj/lib/pointcuts/Pointcuts.class
2011-07-12 16:19:19,857 [ 467064]  DEBUG - pectj.compiler.ajc.AjcCompiler - ajc:  
2011-07-12 16:19:19,857 [ 467064]  DEBUG - pectj.compiler.ajc.AjcCompiler - ajc: when batch building BuildConfig[null] #Files=2515 AopXmls=#0
2011-07-12 16:19:19,857 [ 467064]  DEBUG - pectj.compiler.ajc.AjcCompiler - ajc: Problem processing attributes in org/aspectj/lib/pointcuts/Pointcuts.class
2011-07-12 16:19:19,857 [ 467064]  DEBUG - pectj.compiler.ajc.AjcCompiler - ajc: java.lang.RuntimeException: Problem processing attributes in org/aspectj/lib/pointcuts/Pointcuts.class
2011-07-12 16:19:19,857 [ 467064]  DEBUG - pectj.compiler.ajc.AjcCompiler - ajc:     at org.aspectj.weaver.bcel.BcelObjectType.ensureAspectJAttributesUnpacked(BcelObjectType.java:385)
2011-07-12 16:19:19,857 [ 467064]  DEBUG - pectj.compiler.ajc.AjcCompiler - ajc:     at org.aspectj.weaver.bcel.BcelObjectType.<init>(BcelObjectType.java:162)
2011-07-12 16:19:19,857 [ 467064]  DEBUG - pectj.compiler.ajc.AjcCompiler - ajc:     at org.aspectj.weaver.bcel.BcelWorld.buildBcelDelegate(BcelWorld.java:394)
2011-07-12 16:19:19,857 [ 467064]  DEBUG - pectj.compiler.ajc.AjcCompiler - ajc:     at org.aspectj.weaver.bcel.BcelWorld.addSourceObjectType(BcelWorld.java:474)
2011-07-12 16:19:19,857 [ 467064]  DEBUG - pectj.compiler.ajc.AjcCompiler - ajc:     at org.aspectj.weaver.bcel.BcelWorld.addSourceObjectType(BcelWorld.java:440)
2011-07-12 16:19:19,857 [ 467064]  DEBUG - pectj.compiler.ajc.AjcCompiler - ajc:     at org.aspectj.weaver.bcel.BcelWeaver.addAspectsFromJarFile(BcelWeaver.java:268)
2011-07-12 16:19:19,857 [ 467064]  DEBUG - pectj.compiler.ajc.AjcCompiler - ajc:     at org.aspectj.weaver.bcel.BcelWeaver.addLibraryJarFile(BcelWeaver.java:238)
2011-07-12 16:19:19,858 [ 467065]  DEBUG - pectj.compiler.ajc.AjcCompiler - ajc:     at org.aspectj.ajdt.internal.core.builder.AjBuildManager.initBcelWorld(AjBuildManager.java:864)
2011-07-12 16:19:19,858 [ 467065]  DEBUG - pectj.compiler.ajc.AjcCompiler - ajc:     at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performBuild(AjBuildManager.java:245)
2011-07-12 16:19:19,858 [ 467065]  DEBUG - pectj.compiler.ajc.AjcCompiler - ajc:     at org.aspectj.ajdt.internal.core.builder.AjBuildManager.batchBuild(AjBuildManager.java:181)
2011-07-12 16:19:19,858 [ 467065]  DEBUG - pectj.compiler.ajc.AjcCompiler - ajc:     at org.aspectj.ajdt.ajc.AjdtCommand.doCommand(AjdtCommand.java:112)
2011-07-12 16:19:19,858 [ 467065]  DEBUG - pectj.compiler.ajc.AjcCompiler - ajc:     at org.aspectj.ajdt.ajc.AjdtCommand.runCommand(AjdtCommand.java:60)
2011-07-12 16:19:19,858 [ 467065]  DEBUG - pectj.compiler.ajc.AjcCompiler - ajc:     at org.aspectj.tools.ajc.Main.run(Main.java:371)
2011-07-12 16:19:19,858 [ 467065]  DEBUG - pectj.compiler.ajc.AjcCompiler - ajc:     at org.aspectj.tools.ajc.Main.runMain(Main.java:248)
2011-07-12 16:19:19,858 [ 467065]  DEBUG - pectj.compiler.ajc.AjcCompiler - ajc:     at org.aspectj.tools.ajc.Main.main(Main.java:84)
2011-07-12 16:19:19,858 [ 467065]  DEBUG - pectj.compiler.ajc.AjcCompiler - ajc: Caused by: org.aspectj.weaver.BCException: malformed org.aspectj.weaver.PointcutDeclaration attribute (length:171)java.io.EOFException
2011-07-12 16:19:19,858 [ 467065]  DEBUG - pectj.compiler.ajc.AjcCompiler - ajc: when batch building BuildConfig[null] #Files=2515 AopXmls=#0
2011-07-12 16:19:19,859 [ 467066]  DEBUG - pectj.compiler.ajc.AjcCompiler - ajc:  
2011-07-12 16:19:19,859 [ 467066]  DEBUG - pectj.compiler.ajc.AjcCompiler - ajc:     at org.aspectj.weaver.AjAttribute.read(AjAttribute.java:139)
2011-07-12 16:19:19,859 [ 467066]  DEBUG - pectj.compiler.ajc.AjcCompiler - ajc:     at org.aspectj.weaver.bcel.Utility.readAjAttributes(Utility.java:101)
2011-07-12 16:19:19,859 [ 467066]  DEBUG - pectj.compiler.ajc.AjcCompiler - ajc:     at org.aspectj.weaver.bcel.BcelObjectType.ensureAspectJAttributesUnpacked(BcelObjectType.java:381)
2011-07-12 16:19:19,859 [ 467066]  DEBUG - pectj.compiler.ajc.AjcCompiler - ajc:     ... 14 more
2011-07-12 16:19:19,860 [ 467067]  DEBUG - pectj.compiler.ajc.AjcCompiler - ajc:  
2011-07-12 16:19:19,885 [ 467092]  DEBUG - pectj.compiler.ajc.AjcCompiler - ajc: 2011-jul-12 16:19:19 org.aspectj.weaver.tools.Jdk14Trace info
2011-07-12 16:19:19,885 [ 467092]  DEBUG - pectj.compiler.ajc.AjcCompiler - ajc: INFO: Dumping to stderr
2011-07-12 16:19:19,885 [ 467092]  DEBUG - pectj.compiler.ajc.AjcCompiler - ajc: ---- AspectJ Properties ---
2011-07-12 16:19:19,885 [ 467092]  DEBUG - pectj.compiler.ajc.AjcCompiler - ajc: AspectJ Compiler 1.6.11 built on Tuesday Mar 15, 2011 at 15:31:04 GMT
2011-07-12 16:19:19,885 [ 467092]  DEBUG - pectj.compiler.ajc.AjcCompiler - ajc: ---- Dump Properties ---
2011-07-12 16:19:19,885 [ 467092]  DEBUG - pectj.compiler.ajc.AjcCompiler - ajc: Dump file: Unknown
2011-07-12 16:19:19,885 [ 467092]  DEBUG - pectj.compiler.ajc.AjcCompiler - ajc: Dump reason: java.lang.RuntimeException

0
Comment actions Permalink

Rebuild clears all output and does full recompile - so it _should_ include every source. It's an incremental compilation - after full build and modifying some files - should be shorter.

BTW you mentioned you use 1.6.10, and in a log it's 1.6.11 - don't you have, by accident, duplicate dependencies in a project?

0
Comment actions Permalink

trespasserw wrote:

Rebuild clears all output and does full recompile - so it _should_ include every source.

Of course it should, though I'd expect it to simply point to the source root (like I do with Ant) - not explicitly pointing out every single file with it's full path.

trespasserw wrote:

It's an incremental compilation - after full build and modifying some files - should be shorter.

I do get the same error when trying to compile a single file within a large project.

trespasserw wrote:

BTW you mentioned you use 1.6.10, and in a log it's 1.6.11 - don't you have, by accident, duplicate dependencies in a project?

Since the error occurred inside AspectJ, I gave it a shot to upgrade, but it made no difference.

0

Please sign in to leave a comment.