Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jdt-dev] [ECJ] Heap Increases from the 1.7 to 1.8 Compiler Option

Hello,

I need assistance with the Eclipse Compiler, and I'm hoping someone could provide feedback.

The ECJ in our code used to compile translated JSPs, but it hangs on a particularly large application if the 1.8 source/target is set. Using version 4.20 (last to be built with Java 8), the application needs a heap space of 5GB to compile successfully with 1.8.  (Unfortunately, I cannot test any newer ECJ versions)

However, if 1.7 is selected, then only 1GB of heap is required to compile successfully.   I don't understand why an additional 4GB is required for source / target 1.8.  I understand there are new language features in 1.8, such as Lambdas, but it's a dramatic heap increase.

We can just increase the heap to avoid this problem, but I would like to know why. Has anyone experienced this or knows about this scenario? No out of memory error is reported in the logs, but the threads just hang.

Here's the stack trace for when the error occurs:

CPU usage total: 212.539956241 secs, current category="Application"
Heap bytes allocated since last GC cycle=0 (0x0)
Java callstack:
at org/eclipse/jdt/internal/compiler/lookup/InferenceContext18.substitute(InferenceContext18.java:245(Compiled Code))
at org/eclipse/jdt/internal/compiler/lookup/InferenceContext18.inferInvocationType(InferenceContext18.java:398(Compiled Code))
at org/eclipse/jdt/internal/compiler/lookup/ParameterizedGenericMethodBinding.computeCompatibleMethod18(ParameterizedGenericMethodBinding.java:271(Compiled Code))
at org/eclipse/jdt/internal/compiler/lookup/ParameterizedGenericMethodBinding.computeCompatibleMethod(ParameterizedGenericMethodBinding.java:92(Compiled Code))
at org/eclipse/jdt/internal/compiler/lookup/Scope.computeCompatibleMethod(Scope.java:844(Compiled Code))
at org/eclipse/jdt/internal/compiler/lookup/Scope.computeCompatibleMethod(Scope.java:801(Compiled Code))
at org/eclipse/jdt/internal/compiler/lookup/Scope.findMethod0(Scope.java:1759(Compiled Code))
at org/eclipse/jdt/internal/compiler/lookup/Scope.findMethod(Scope.java:1660(Compiled Code))
at org/eclipse/jdt/internal/compiler/lookup/Scope.getMethod(Scope.java:3048(Compiled Code))
at org/eclipse/jdt/internal/compiler/ast/MessageSend.findMethodBinding(MessageSend.java:1018(Compiled Code))
at org/eclipse/jdt/internal/compiler/ast/MessageSend.resolveType(MessageSend.java:839(Compiled Code))
at org/eclipse/jdt/internal/compiler/ast/_expression_.resolve(_expression_.java:1113(Compiled Code))
at org/eclipse/jdt/internal/compiler/ast/Block.resolve(Block.java:131(Compiled Code))
at org/eclipse/jdt/internal/compiler/ast/IfStatement.resolveIfStatement(IfStatement.java:291(Compiled Code))
at org/eclipse/jdt/internal/compiler/ast/IfStatement.resolve(IfStatement.java:317(Compiled Code))
at org/eclipse/jdt/internal/compiler/ast/AbstractMethodDeclaration.resolveStatements(AbstractMethodDeclaration.java:661(Compiled Code))
at org/eclipse/jdt/internal/compiler/ast/MethodDeclaration.resolveStatements(MethodDeclaration.java:362(Compiled Code))
at org/eclipse/jdt/internal/compiler/ast/AbstractMethodDeclaration.resolve(AbstractMethodDeclaration.java:570(Compiled Code))
at org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.resolve(TypeDeclaration.java:1512(Compiled Code))
at org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.resolve(TypeDeclaration.java:1637(Compiled Code))
at org/eclipse/jdt/internal/compiler/ast/CompilationUnitDeclaration.resolve(CompilationUnitDeclaration.java:667(Compiled Code))
at org/eclipse/jdt/internal/compiler/Compiler.process(Compiler.java:902)
at org/eclipse/jdt/internal/compiler/Compiler.processCompiledUnits(Compiler.java:575)
at org/eclipse/jdt/internal/compiler/Compiler.compile(Compiler.java:475)
at org/eclipse/jdt/internal/compiler/Compiler.compile(Compiler.java:426)
at com/ibm/ws/jsp/translator/compiler/JDTCompiler.compile(JDTCompiler.java:178)


I've attached a  screenshot with additional information.  
Screenshot 2023-11-17 at 9.21.23 AM.png


Any guidance is appreciated.

Thank you,
Volodymyr

Back to the top