Repository: spark Updated Branches: refs/heads/master c5583fdcd -> 7c36ee46d
[SPARK-25290][CORE][TEST] Reduce the size of acquired arrays to avoid OOM error ## What changes were proposed in this pull request? `BytesToBytesMapOnHeapSuite`.`randomizedStressTest` caused `OutOfMemoryError` on several test runs. Seems better to reduce memory usage in this test. ## How was this patch tested? Unit tests. Closes #22297 from viirya/SPARK-25290. Authored-by: Liang-Chi Hsieh <[email protected]> Signed-off-by: Wenchen Fan <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/spark/repo Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/7c36ee46 Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/7c36ee46 Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/7c36ee46 Branch: refs/heads/master Commit: 7c36ee46d974021474d8098f87f70440a10319ee Parents: c5583fd Author: Liang-Chi Hsieh <[email protected]> Authored: Sat Sep 1 16:25:29 2018 +0800 Committer: Wenchen Fan <[email protected]> Committed: Sat Sep 1 16:25:29 2018 +0800 ---------------------------------------------------------------------- .../apache/spark/unsafe/map/AbstractBytesToBytesMapSuite.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/spark/blob/7c36ee46/core/src/test/java/org/apache/spark/unsafe/map/AbstractBytesToBytesMapSuite.java ---------------------------------------------------------------------- diff --git a/core/src/test/java/org/apache/spark/unsafe/map/AbstractBytesToBytesMapSuite.java b/core/src/test/java/org/apache/spark/unsafe/map/AbstractBytesToBytesMapSuite.java index 03cec8e..53a233f 100644 --- a/core/src/test/java/org/apache/spark/unsafe/map/AbstractBytesToBytesMapSuite.java +++ b/core/src/test/java/org/apache/spark/unsafe/map/AbstractBytesToBytesMapSuite.java @@ -379,7 +379,7 @@ public abstract class AbstractBytesToBytesMapSuite { @Test public void randomizedStressTest() { - final int size = 65536; + final int size = 32768; // Java arrays' hashCodes() aren't based on the arrays' contents, so we need to wrap arrays // into ByteBuffers in order to use them as keys here. final Map<ByteBuffer, byte[]> expected = new HashMap<>(); @@ -388,7 +388,7 @@ public abstract class AbstractBytesToBytesMapSuite { // Fill the map to 90% full so that we can trigger probing for (int i = 0; i < size * 0.9; i++) { final byte[] key = getRandomByteArray(rand.nextInt(256) + 1); - final byte[] value = getRandomByteArray(rand.nextInt(512) + 1); + final byte[] value = getRandomByteArray(rand.nextInt(256) + 1); if (!expected.containsKey(ByteBuffer.wrap(key))) { expected.put(ByteBuffer.wrap(key), value); final BytesToBytesMap.Location loc = map.lookup( --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
