Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OutOfMemoryError with Maven #4310

Closed
NadChel opened this issue May 17, 2024 · 1 comment
Closed

OutOfMemoryError with Maven #4310

NadChel opened this issue May 17, 2024 · 1 comment

Comments

@NadChel
Copy link

NadChel commented May 17, 2024

I try to introduce Dagger in our Swing project, but so far it's not very successful. The build fails with OutOfMemoryError

We have a "common lib" proprietary dependency that is declared in our modules. It has 3700+ sources, but there is very little DI code at this point

Here's the pom of "common lib":

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <compilerArguments>
                        <XDignore.symbol.file/>
                    </compilerArguments>
                    <fork>true</fork>
                    <annotationProcessorPaths>
                        <path>
                            <groupId>com.google.dagger</groupId>
                            <artifactId>dagger-compiler</artifactId>
                            <version>${dagger.ver}</version>
                        </path>
                    </annotationProcessorPaths>
                </configuration>
            </plugin>

Maven is 3.11, Dagger is 2.51.1. Java 8

The heap size seems more than sufficient

C:\Users\zolotarevsa>   java -XX:+PrintFlagsFinal -version | findstr MaxHeapSize                                            
uintx MaxHeapSize                              := 4278190080                          {product}                     
openjdk version "1.8.0_282"                                                                                             
OpenJDK Runtime Environment (build 1.8.0_282-b08)                                                                       
OpenJDK 64-Bit Server VM (build 25.282-b08, mixed mode)

The error message:

java: java.lang.OutOfMemoryError: GC overhead limit exceeded
java.lang.RuntimeException: java.lang.OutOfMemoryError: GC overhead limit exceeded
	at com.sun.tools.javac.main.Main.compile(Main.java:559)
	at com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:129)
	at com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:138)
	at org.jetbrains.jps.javac.JavacMain.compile(JavacMain.java:239)
	at org.jetbrains.jps.javac.ExternalJavacProcess.compile(ExternalJavacProcess.java:189)
	at org.jetbrains.jps.javac.ExternalJavacProcess.access$400(ExternalJavacProcess.java:28)
	at org.jetbrains.jps.javac.ExternalJavacProcess$CompilationRequestsHandler$1.run(ExternalJavacProcess.java:262)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.OutOfMemoryError: GC overhead limit exceeded
	at java.util.Arrays.copyOfRange(Arrays.java:3664)
	at java.lang.StringBuffer.toString(StringBuffer.java:669)
	at java.net.URI.toString(URI.java:1945)
	at java.net.URI.<init>(URI.java:669)
	at java.net.URI.<init>(URI.java:774)
	at org.jetbrains.jps.javac.ZipFileObject.createUri(ZipFileObject.java:39)
	at org.jetbrains.jps.javac.ZipFileObject.<init>(ZipFileObject.java:21)
	at org.jetbrains.jps.javac.DefaultFileOperations$ZipArchive$2.fun(DefaultFileOperations.java:231)
	at org.jetbrains.jps.javac.DefaultFileOperations$ZipArchive$2.fun(DefaultFileOperations.java:228)
	at org.jetbrains.jps.javac.Iterators$10.next(Iterators.java:235)
	at org.jetbrains.jps.javac.Iterators$6.next(Iterators.java:160)
	at com.sun.tools.javac.api.ClientCodeWrapper.wrapJavaFileObjects(ClientCodeWrapper.java:140)
	at com.sun.tools.javac.api.ClientCodeWrapper$WrappedJavaFileManager.list(ClientCodeWrapper.java:231)
	at com.sun.tools.javac.jvm.ClassReader.fillIn(ClassReader.java:2750)
	at com.sun.tools.javac.jvm.ClassReader.complete(ClassReader.java:2446)
	at com.sun.tools.javac.jvm.ClassReader.access$000(ClassReader.java:76)
	at com.sun.tools.javac.jvm.ClassReader$1.complete(ClassReader.java:240)
	at com.sun.tools.javac.code.Symbol.complete(Symbol.java:574)
	at com.sun.tools.javac.jvm.ClassReader.completeOwners(ClassReader.java:2458)
	at com.sun.tools.javac.jvm.ClassReader.complete(ClassReader.java:2435)
	at com.sun.tools.javac.jvm.ClassReader.access$000(ClassReader.java:76)
	at com.sun.tools.javac.jvm.ClassReader$1.complete(ClassReader.java:240)
	at com.sun.tools.javac.code.Symbol.complete(Symbol.java:574)
	at com.sun.tools.javac.code.Symbol$ClassSymbol.complete(Symbol.java:1037)
	at com.sun.tools.javac.code.Symbol$ClassSymbol.members(Symbol.java:978)
	at com.sun.tools.javac.jvm.ClassReader$AnnotationDeproxy.findAccessMethod(ClassReader.java:1769)
	at com.sun.tools.javac.jvm.ClassReader$AnnotationDeproxy.deproxyCompound(ClassReader.java:1759)
	at com.sun.tools.javac.jvm.ClassReader$AnnotationDeproxy.deproxyCompoundList(ClassReader.java:1748)
	at com.sun.tools.javac.jvm.ClassReader$AnnotationCompleter.run(ClassReader.java:1943)
	at com.sun.tools.javac.comp.Annotate.flush(Annotate.java:143)
	at com.sun.tools.javac.comp.Annotate.enterDone(Annotate.java:129)
	at com.sun.tools.javac.comp.Enter.complete(Enter.java:512)

It may have to do with IntelliJ, but in case it's not (after all, it didn't occur before the introduction of Dagger), I decided to post this

I noticed this earlier issue, but it concerns an older version of Dagger, Kotlin, and Gradle

@NadChel
Copy link
Author

NadChel commented May 17, 2024

On second thought, I built with IntelliJ that has its own limit

image

It built fine with Maven

Sorry for the inconvenience. It's Friday

@NadChel NadChel closed this as completed May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant