Announcement Announcement Module
Collapse
No announcement yet.
OutOfMemoryError when compiling aspectj Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • OutOfMemoryError when compiling aspectj

    I am using Roo to reverse engineer a postgres database with 107 tables, and using the 'gwt setup' command to generate the gwt configuration and UI pages. All this works ok until it comes to compiling. When Maven does its build it creates a separate java.exe process (from within STS) that seems limited to 256m of memory used. After a few min on the aspectj:compile process an OutOfMemour error is thrown. Is there a way to increase the memory allocated to the newly spawned java.exe process used for compiling?


    I have also setup a Ubuntu 10.x box with Continuum on it as a build server and it also reports out of memory errors when doing the aspectj:compile goal. I have edited the 'bin/mvn' script to set Xmx to 1024m and XX:MaxPermSize to 512m.

    Any ideas on how to resolve this problem would be very much appreciated.



    Code:
    [INFO] [aspectj:compile {execution: default}]
    [ERROR] Internal compiler error
    java.lang.OutOfMemoryError: Java heap space
            at org.aspectj.apache.bcel.classfile.Attribute.readAttribute(Attribute.java:129)
            at org.aspectj.apache.bcel.classfile.AttributeUtils.readAttributes(AttributeUtils.java:19)
            at org.aspectj.apache.bcel.classfile.FieldOrMethod.<init>(FieldOrMethod.java:97)
            at org.aspectj.apache.bcel.classfile.Method.<init>(Method.java:97)
            at org.aspectj.apache.bcel.classfile.ClassParser.readMethods(ClassParser.java:240)
            at org.aspectj.apache.bcel.classfile.ClassParser.parse(ClassParser.java:144)
            at org.aspectj.weaver.bcel.BcelWorld.lookupJavaClass(BcelWorld.java:424)
            at org.aspectj.weaver.bcel.BcelWorld.resolveDelegate(BcelWorld.java:376)
            at org.aspectj.weaver.World.resolveToReferenceType(World.java:461)
            at org.aspectj.weaver.World.resolve(World.java:305)
            at org.aspectj.weaver.World.resolve(World.java:218)
            at org.aspectj.weaver.bcel.BcelObjectType.getSuperclass(BcelObjectType.java:237)
            at org.aspectj.weaver.ReferenceType.getSuperclass(ReferenceType.java:906)
            at org.aspectj.weaver.patterns.ExactAnnotationTypePattern.matches(ExactAnnotationTypePattern.java:194)
            at org.aspectj.weaver.patterns.ExactAnnotationTypePattern.matches(ExactAnnotationTypePattern.java:96)
            at org.aspectj.weaver.patterns.ExactTypePattern.matchesExactly(ExactTypePattern.java:165)
            at org.aspectj.weaver.patterns.TypePattern.matchesSubtypes(TypePattern.java:193)
            at org.aspectj.weaver.patterns.TypePattern.matchesSubtypes(TypePattern.java:204)
            at org.aspectj.weaver.patterns.TypePattern.matchesSubtypes(TypePattern.java:204)
            at org.aspectj.weaver.patterns.TypePattern.matchesSubtypes(TypePattern.java:184)
            at org.aspectj.weaver.patterns.ExactTypePattern.matchesSubtypes(ExactTypePattern.java:74)
            at org.aspectj.weaver.patterns.TypePattern.matchesStatically(TypePattern.java:131)
            at org.aspectj.weaver.patterns.DeclareParents.match(DeclareParents.java:63)
            at org.aspectj.weaver.patterns.DeclareParents.findMatchingNewParents(DeclareParents.java:358)
            at org.aspectj.weaver.bcel.BcelWeaver.applyDeclareParents(BcelWeaver.java:1577)
            at org.aspectj.weaver.bcel.BcelWeaver.weaveParentTypeMungers(BcelWeaver.java:1452)
            at org.aspectj.weaver.bcel.BcelWeaver.weaveParentsFor(BcelWeaver.java:1305)
            at org.aspectj.weaver.bcel.BcelWeaver.weave(BcelWeaver.java:1108)
            at org.aspectj.ajdt.internal.compiler.AjPipeliningCompilerAdapter.weaveQueuedEntries(AjPipeliningCompilerAdapter.java:514)
            at org.aspectj.ajdt.internal.compiler.AjPipeliningCompilerAdapter.queueForWeaving(AjPipeliningCompilerAdapter.java:447)
            at org.aspectj.ajdt.internal.compiler.AjPipeliningCompilerAdapter.afterProcessing(AjPipeliningCompilerAdapter.java:432)
            at org.aspectj.ajdt.internal.compiler.CompilerAdapter.ajc$after$org_aspectj_ajdt_internal_compiler_CompilerAdapter$5$6b855184(CompilerAdapter.aj:98)

  • #2
    Hi,

    Do you know which version of AspectJ you are using?

    If you are on 1.6.10 you can set a system property to reduce memory usage (at the cost of performance).

    aspectj.typeDemotion=true

    This parameter is a work in progress - which is why it isn't the default behaviour yet. That may help. I'm not sure how to increase the memory available to that process that is spawned whilst running under STS (unless it gets a launch configuration, in which case you can edit it, of course).

    Andy
    ---
    Andy Clement
    SpringSource

    Comment


    • #3
      Thanks Andy, very helpful.

      I added the option as per instructions at http://eclipse.org/aspectj/doc/relea...ADME-1610.html and can now compile in STS.

      Comment

      Working...
      X