2016-11-24 2 views
0
을 실행하는 동안 나는 4 년 봄 3에서 응용 프로그램을 업그레이드하고 지금 3 4. 정확한 버전을 최대 절전 모드에서 일하고있다

: 봄 : 4.1.9 최대 절전 모드 : 인해 4.3.7자바 힙 공간 문제 Junits

의존성에 나는 또한 Junit 버전을 업그레이드해야하고 현재 4.12를 사용하고 있습니다.

업그레이드 이후는 단위 테스트의 대부분을 자바 힙 공간 예외를 얻고있다 :

net.sf.ehcache.CacheException: java.lang.OutOfMemoryError: Java heap space 
    at net.sf.ehcache.CacheManager.init(CacheManager.java:361) 
    at net.sf.ehcache.CacheManager.<init>(CacheManager.java:237) 
    at net.sf.ehcache.CacheManager.create(CacheManager.java:856) 
    at net.sf.ehcache.CacheManager.create(CacheManager.java:743) 
    at net.sf.ehcache.CacheManager.getInstance(CacheManager.java:758) 
    at com.rsa.csd.RsaBaseTestCase.setUp(RsaBaseTestCase.java:144) 
    at junit.framework.TestCase.runBare(TestCase.java:139) 
    at junit.framework.TestResult$1.protect(TestResult.java:122) 
    at junit.framework.TestResult.runProtected(TestResult.java:142) 
    at junit.framework.TestResult.run(TestResult.java:125) 
    at junit.framework.TestCase.run(TestCase.java:129) 
    at junit.framework.TestSuite.runTest(TestSuite.java:252) 
    at junit.framework.TestSuite.run(TestSuite.java:247) 
    at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:86) 
    at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:234) 
    at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:133) 
    at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:114) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
    at java.lang.reflect.Method.invoke(Method.java:606) 
    at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:188) 
    at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:166) 
    at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:86) 
    at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:101) 
    at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:74) 
Caused by: java.lang.OutOfMemoryError: Java heap space 
    at net.sf.ehcache.store.chm.ConcurrentHashMap$HashEntry.newArray(ConcurrentHashMap.java:226) 
    at net.sf.ehcache.store.chm.ConcurrentHashMap$Segment.<init>(ConcurrentHashMap.java:316) 
    at net.sf.ehcache.store.chm.SelectableConcurrentHashMap$MemoryStoreSegment.<init>(SelectableConcurrentHashMap.java:270) 
    at net.sf.ehcache.store.chm.SelectableConcurrentHashMap$MemoryStoreSegment.<init>(SelectableConcurrentHashMap.java:262) 
    at net.sf.ehcache.store.chm.SelectableConcurrentHashMap.createSegment(SelectableConcurrentHashMap.java:245) 
    at net.sf.ehcache.store.chm.ConcurrentHashMap.<init>(ConcurrentHashMap.java:634) 
    at net.sf.ehcache.store.chm.SelectableConcurrentHashMap.<init>(SelectableConcurrentHashMap.java:52) 
    at net.sf.ehcache.store.MemoryStore.<init>(MemoryStore.java:146) 
    at net.sf.ehcache.store.NotifyingMemoryStore.<init>(NotifyingMemoryStore.java:37) 
    at net.sf.ehcache.store.NotifyingMemoryStore.create(NotifyingMemoryStore.java:49) 
    at net.sf.ehcache.store.MemoryOnlyStore.create(MemoryOnlyStore.java:69) 
    at net.sf.ehcache.Cache.initialise(Cache.java:1105) 
    at net.sf.ehcache.CacheManager.initializeEhcache(CacheManager.java:1128) 
    at net.sf.ehcache.CacheManager.addCacheNoCheck(CacheManager.java:1159) 
    at net.sf.ehcache.CacheManager.addConfiguredCaches(CacheManager.java:708) 
    at net.sf.ehcache.CacheManager.doInit(CacheManager.java:426) 
    at net.sf.ehcache.CacheManager.init(CacheManager.java:352) 
    at net.sf.ehcache.CacheManager.<init>(CacheManager.java:237) 
    at net.sf.ehcache.CacheManager.create(CacheManager.java:856) 
    at net.sf.ehcache.CacheManager.create(CacheManager.java:743) 
    at net.sf.ehcache.CacheManager.getInstance(CacheManager.java:758) 
    at com.rsa.csd.RsaBaseTestCase.setUp(RsaBaseTestCase.java:144) 
    at junit.framework.TestCase.runBare(TestCase.java:139) 
    at junit.framework.TestResult$1.protect(TestResult.java:122) 
    at junit.framework.TestResult.runProtected(TestResult.java:142) 
    at junit.framework.TestResult.run(TestResult.java:125) 
    at junit.framework.TestCase.run(TestCase.java:129) 
    at junit.framework.TestSuite.runTest(TestSuite.java:252) 
    at junit.framework.TestSuite.run(TestSuite.java:247) 
    at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:86) 
    at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:234) 
    at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:133) 

내가 온라인 검색을 시도했지만 어떤 해결책을 찾을 수 있었다 havent 한.

내가 게시해야하는 설정 파일을 알려주십시오.

+0

어떤 버전의 ehcache가 사용되고 있습니까? 나는 최신 2.x 버전을 사용하도록 업데이트 할 것이다. 그렇다면'ehcache.xml' 파일을 가지고 있습니까? – Henri

+0

ehcache 2.5를 사용하고 있습니다. 지금 사무실 노트북에 액세스 할 수 없습니다. 가능한 한 빨리 파일을 공유합니다. – Sid

답변

0

실행 구성으로 이동 한 다음 인수로 vm arguments을 설정할 수 있습니다. 인수 탭에서 VM 인수를 "-Xms64m -Xmx256m" 이상으로 설정하면 시스템 구성에 따라 다릅니다.

+0

시도해 보았습니다. 최대 4GB로 설정했지만 여전히 동일한 예외가 발생했습니다. – Sid

+0

당신이 사용하고있는 것은 무엇입니까? eclipse를 사용하는 경우, eclipse.ini에서 eclipse에 할당 된 메모리를 늘리십시오. – Mohit

+0

명령 프롬프트에서 테스트 사례를 실행할 때도이 문제가 발생하므로 관련 이슈가 있는지 확실하지 않습니다. – Sid