IDEA java.lang.OutOfMemoryError: Java heap space-内存溢出问题

1,604 阅读2分钟

报错信息 [INFO] Final Memory: 49M/246M [INFO] ------------------------------------------------------------------------ [ERROR] Java heap space -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] cwiki.apache.org/confluence/…

Process finished with exit code 1

第一步:配置环境变量:MAVEN C:\Users>set MAVEN_OPTS=-Xmx1024m -XX:MaxPermSize=512m

C:\Users>mvn set MAVEN_OPTS=-Xmx1024m -XX:MaxPermSize=512m

Java HotSpot(TM) Client VM warning: ignoring option MaxPermSize=512m; support was removed in 8.0 Apache Maven 3.6.0 (97c98ec64a1fdfee7767ce5ffb20918da4f719f3; 2018-10-25T02:41:47+08:00) Maven home: D:\tools\apache-maven-3.6.0\bin.. Java version: 1.8.0_144, vendor: Oracle Corporation, runtime: D:\Program Files (x86)\Java\jdk1.8.0_144\jre Default locale: zh_CN, platform encoding: GBK OS name: "windows 10", version: "10.0", arch: "x86", family: "windows" [DEBUG] Created new class realm maven.api [DEBUG] Importing foreign packages into class realm maven.api [DEBUG] Imported: javax.annotation.* < plexus.core [DEBUG] Imported: javax.annotation.security.* < plexus.core [DEBUG] Imported: javax.enterprise.inject.* < plexus.core [DEBUG] Imported: javax.enterprise.util.* < plexus.core [DEBUG] Imported: javax.inject.* < plexus.core [DEBUG] Imported: org.apache.maven.* < plexus.core [DEBUG] Imported: org.apache.maven.artifact < plexus.core [DEBUG] Imported: org.apache.maven.classrealm < plexus.core [DEBUG] Imported: org.apache.maven.cli < plexus.core [DEBUG] Imported: org.apache.maven.configuration < plexus.core

第三步 C:\Users>mvn -version Java HotSpot(TM) Client VM warning: ignoring option MaxPermSize=512m; support was removed in 8.0 Apache Maven 3.6.0 (97c98ec64a1fdfee7767ce5ffb20918da4f719f3; 2018-10-25T02:41:47+08:00) Maven home: D:\tools\apache-maven-3.6.0\bin.. Java version: 1.8.0_144, vendor: Oracle Corporation, runtime: D:\Program Files (x86)\Java\jdk1.8.0_144\jre Default locale: zh_CN, platform encoding: GBK OS name: "windows 10", version: "10.0", arch: "x86", family: "windows" C:>

image.png -Xms1024m -Xmx2048m -Xss1m image.png -Xms1024m -Xmx2048m -Xss1m image.png

成功提示

[INFO] --------------------------------[ war ]--------------------------------- [INFO] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ CLReportService --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] Copying 0 resource [INFO] Copying 16 resources [INFO] [INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ CLReportService --- [INFO] Nothing to compile - all classes are up to date [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 2.094 s [INFO] Finished at: 2022-04-06T17:09:21+08:00 [INFO] ------------------------------------------------------------------------