burlap Tests run: 10, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 18.605 sec <<< FAILURE! testSimpleHashFactoryLargeState(burlap.testing.TestHashing) Time elapsed: 15.506 sec <<< ERROR! java.lang.OutOfMemoryError: Java heap space

burlap Tests run: 10, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 18.605 sec <<< FAILURE! testSimpleHashFactoryLargeState(burlap.testing.TestHashing) Time elapsed: 15.506 sec <<< ERROR! java.lang.OutOfMemoryError: Java heap space

主要错误原因:

Tests run: 10, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 18.605 sec <<< FAILURE!
testSimpleHashFactoryLargeState(burlap.testing.TestHashing)  Time elapsed: 15.506 sec  <<< ERROR!
java.lang.OutOfMemoryError: Java heap space

使用的windows 64位,eclipse使用的32位,从而导致了在测试hashmap时内存不够运行停止的情况

修改了TestHashing.java中的hashmap的数量(从10000变成了80000)

@Test
public void testSimpleHashFactoryLargeState() {
HashableStateFactory factory = new SimpleHashableStateFactory();

testSimpleHashFactoryLargeState(factory, 10, 100, false);
testSimpleHashFactoryLargeState(factory, 50, 1000, false);
testSimpleHashFactoryLargeState(factory, 100, 10000, false);
testSimpleHashFactoryLargeState(factory, 200,100000, false);
testSimpleHashFactoryLargeState(factory, 500,100000, false);

testSimpleHashFactoryLargeState(factory, 10, 100, true);
testSimpleHashFactoryLargeState(factory, 20, 1000, true);
testSimpleHashFactoryLargeState(factory, 50, 10000, true);
testSimpleHashFactoryLargeState(factory, 100,100000, true);

}

@Test
public void testSimpleHashFactoryLargeState() {
HashableStateFactory factory = new SimpleHashableStateFactory();

testSimpleHashFactoryLargeState(factory, 10, 100, false);
testSimpleHashFactoryLargeState(factory, 50, 1000, false);
testSimpleHashFactoryLargeState(factory, 100, 10000, false);
testSimpleHashFactoryLargeState(factory, 200,80000, false);
testSimpleHashFactoryLargeState(factory, 500,80000, false);

testSimpleHashFactoryLargeState(factory, 10, 100, true);
testSimpleHashFactoryLargeState(factory, 20, 1000, true);
testSimpleHashFactoryLargeState(factory, 50, 10000, true);
testSimpleHashFactoryLargeState(factory, 100,80000, true);

}

Running burlap.testing.TestPlanning

Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.013 sec
Running burlap.testing.TestSuite
Hashed states: 86, hashes: 86
Hashed states: 587, hashes: 537
Hashed states: 1277, hashes: 1106
Hashed states: 2777, hashes: 2282
Hashed states: 7605, hashes: 6093
Hashed states: 100, hashes: 100
Hashed states: 1000, hashes: 1000
Hashed states: 10000, hashes: 10000
10000
20000
30000
40000
50000
60000
70000
80000
Hashed states: 104, hashes: 104
Tests run: 10, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 18.605 sec <<< FAILURE!
testSimpleHashFactoryLargeState(burlap.testing.TestHashing)  Time elapsed: 15.506 sec  <<< ERROR!
java.lang.OutOfMemoryError: Java heap space
at java.util.Arrays.copyOf(Unknown Source)
at java.util.Arrays.copyOf(Unknown Source)
at java.util.ArrayList.toArray(Unknown Source)
at java.util.ArrayList.addAll(Unknown Source)
at burlap.domain.singleagent.gridworld.state.GridWorldState.objects(GridWorldState.java:124)
at burlap.statehashing.simple.IISimpleHashableState.computeOOHashCode(IISimpleHashableState.java:59)
at burlap.statehashing.simple.IISimpleHashableState.computeHashCode(IISimpleHashableState.java:50)
at burlap.statehashing.simple.IISimpleHashableState.hashCode(IISimpleHashableState.java:27)
at java.util.HashMap.hash(Unknown Source)
at java.util.HashMap.put(Unknown Source)
at java.util.HashSet.add(Unknown Source)
at burlap.testing.TestHashing.generateRandomStates(TestHashing.java:217)
at burlap.testing.TestHashing.testSimpleHashFactoryLargeState(TestHashing.java:104)
at burlap.testing.TestHashing.testSimpleHashFactoryLargeState(TestHashing.java:96)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)

Results :

Tests in error: 
  testSimpleHashFactoryLargeState(burlap.testing.TestHashing): Java heap space
  testSimpleHashFactoryLargeState(burlap.testing.TestHashing): Java heap space

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

[INFO] ————————————————————————
[INFO] BUILD FAILURE
[INFO] ————————————————————————
[INFO] Total time: 41.430 s
[INFO] Finished at: 2017-06-08T16:28:48+09:00
[INFO] Final Memory: 7M/18M
[INFO] ————————————————————————
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-test) on project burlap_examples: There are test failures.
[ERROR] 
[ERROR] Please refer to E:\javarlcode32\burlap-master\burlap-master\target\surefire-reports for the individual test results.
[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/MojoFailureException

发表评论

电子邮件地址不会被公开。 必填项已用*标注