2013-06-13 3 views
1

Java Spring-WS-Application 서버를 작성했으며 maven을 사용하여 명령 줄에서 배포하려고합니다. 그러나 "mvn clean package"를 실행하려고하면 힙 공간 부족으로 인해 Java 가상 머신을 만들 수 없다고 알려줍니다. 내 컴퓨터에는 4GB의 RAM 만 있으며 슬프게도 32 비트 창을 실행합니다. 배포는 -DskipTests를 포함하는 한 성공적입니다.java virtual machine 크래킹

이 프로젝트는 우리 팀에서 작성한 다른 프로젝트에 종속되어 있으며 "mvn clean install"을 사용하여 문제없이 배포 할 수 있습니다. 나는 문제없이 다른 서버도 배포 할 수 있으므로 내 Java 버전이 손상되지 않았다고 생각하지 않습니다. 또한 내 개발 팀의 다른 구성원이이 서버를 자신의 컴퓨터에 성공적으로 배포 할 수있었습니다.

오류 테스트를 시도하고 찾기 위해 @Test 주석을 모두 주석 처리했지만 주석을 제거했지만 아직 실행할 테스트가 없을 때도이 오류가 표시됩니다.

왜 이런 일이 벌어지고 있을지 생각해보십시오.

Java 버전 :에서

java version "1.7.0_21" 
Java(TM) SE Runtime Environment (build 1.7.0_21-b11) 
Java HotSpot(TM) Client VM (build 23.21-b01, mixed mode, sharing) 

결과 "MVN 깨끗한 패키지 :"

C:\workspace\My-Project>mvn clean package 
[INFO] Scanning for projects... 
[INFO] 
[INFO] ------------------------------------------------------------------------ 
[INFO] Building My Project Spring-WS Application 1.0.0-SNAPSHOT 
[INFO] ------------------------------------------------------------------------ 
[INFO] 
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ my-project --- 
[INFO] Deleting C:\workspace\My-Project\target 
[INFO] 
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ my-project --- 
[debug] execute contextualize 
[INFO] Using 'UTF-8' encoding to copy filtered resources. 
[INFO] skip non existing resourceDirectory C:\workspace\My-Project\src\main\resources 
[INFO] 
[INFO] --- maven-compiler-plugin:3.0:compile (default-compile) @ my-project --- 
[INFO] Changes detected - recompiling the module! 
[INFO] Compiling 49 source files to C:\workspace\My-Project\target\classes 
[WARNING] Note: C:\workspace\My-Project\src\main\java\my\package\of\doom\impl\classImpl.java uses or overrides a 
deprecated API. 
[WARNING] Note: Recompile with -Xlint:deprecation for details. 
[INFO] 
[INFO] --- maven-resources-plugin:2.5:testResources (default-testResources) @ my-project --- 
[debug] execute contextualize 
[INFO] Using 'UTF-8' encoding to copy filtered resources. 
[INFO] Copying 1 resource 
[INFO] 
[INFO] --- maven-compiler-plugin:3.0:testCompile (default-testCompile) @ my-project --- 
[INFO] Changes detected - recompiling the module! 
[INFO] Compiling 25 source files to C:\workspace\My-Project\target\test-classes 
[INFO] 
[INFO] --- maven-surefire-plugin:2.14:test (default-test) @ my-project --- 
[INFO] Surefire report directory: C:\workspace\My-Project\target\surefire-reports 

------------------------------------------------------- 
T E S T S 
------------------------------------------------------- 
Error occurred during initialization of VM 
Could not create the Java virtual machine. 
Could not reserve enough space for object heap 

Results : 

Tests run: 0, Failures: 0, Errors: 0, Skipped: 0 

[INFO] ------------------------------------------------------------------------ 
[INFO] BUILD FAILURE 
[INFO] ------------------------------------------------------------------------ 
[INFO] Total time: 8.783s 
[INFO] Finished at: Thu Jun 13 09:01:15 EDT 2013 
[INFO] Final Memory: 14M/54M 
[INFO] ------------------------------------------------------------------------ 
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.14:test (default-test) on project my-pro 
ject: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.14:test failed: The fo 
rked VM terminated without saying properly goodbye. VM crash or System.exit called ? 
[ERROR] Command wascmd.exe /X /C "C:\Oracle2\Middleware\jdk160_24\jre\bin\java -Xms512m -Xmx1024m -XX:MaxPermSize=512m - 
jar C:\workspace\My-Project\target\surefire\surefirebooter4008500116671254841.jar C:\workspace\My-Project\target\surefir 
e\surefire8598565507069545685tmp C:\workspace\My-Project\target\surefire\surefire_07977292658698847040tmp" 
[ERROR] ->  [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] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException 

Eclipse.ini : 오류 메시지에 밀접하게

-vm 
C:/Oracle2/Middleware/jdk160_24/bin/javaw 
-startup 
plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar 
--launcher.library 
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.100.v20110502 
-showsplash 
org.eclipse.platform 
--launcher.defaultAction 
openFile 
-vmargs 
-Xms512m 
-Xmx1024m 
-XX:MaxPermSize=512m 
-Dsun.lang.ClassLoader.allowArraySyntax=true 
+1

최대 허용 크기 512m? 아야. '-Xmx' 매개 변수 값을 시도해 보셨습니까? – fge

+0

그는 -Xmx를 1024m로 설정합니다. – Jason

+0

메모리가 충분하면 Xms, Xmx 및 MaxPermSize를 늘리십시오. 서버가 얼마나 많은 메모리를 필요로하는지 확인 했습니까? – Martin

답변

1

봐. 테스트 JVM의 힙에 충분한 메모리가 없다고 말합니다. 일부 메모리를 해제 (Eclipse 종료)하거나 낮은 heap/perm gen 크기 (확실한 설정)로 테스트를 실행하십시오.

+0

라인을 찾았습니다. 확실한 설정에서 -Xms512m -Xmx1024m -XX : MaxPermSize = 512m 을 찾았습니다. 해당 라인을 제거하거나 MaxPermSize를 256m으로 변경하면 문제가 해결되는 것 같습니다. 감사! 호기심에서 벗어나 왜 퍼 멘젠 (Permgen) 크기를 줄이면이 ​​문제를 해결할 수 있는지 알고 있습니까? – sparks

+0

Permgen 공간은 메모리에서 예약되어 있으므로 큰 perm gen 공간이 힙에 필요한 공간을 차지합니다. – Jukka

관련 문제