-
- Downloads
[SPARK-13210][SQL] catch OOM when allocate memory and expand array
There is a bug when we try to grow the buffer, OOM is ignore wrongly (the assert also skipped by JVM), then we try grow the array again, this one will trigger spilling free the current page, the current record we inserted will be invalid. The root cause is that JVM has less free memory than MemoryManager thought, it will OOM when allocate a page without trigger spilling. We should catch the OOM, and acquire memory again to trigger spilling. And also, we could not grow the array in `insertRecord` of `InMemorySorter` (it was there just for easy testing). Author: Davies Liu <davies@databricks.com> Closes #11095 from davies/fix_expand.
Showing
- core/src/main/java/org/apache/spark/memory/TaskMemoryManager.java 22 additions, 1 deletion.../main/java/org/apache/spark/memory/TaskMemoryManager.java
- core/src/main/java/org/apache/spark/shuffle/sort/ShuffleExternalSorter.java 1 addition, 9 deletions.../org/apache/spark/shuffle/sort/ShuffleExternalSorter.java
- core/src/main/java/org/apache/spark/shuffle/sort/ShuffleInMemorySorter.java 1 addition, 1 deletion.../org/apache/spark/shuffle/sort/ShuffleInMemorySorter.java
- core/src/main/java/org/apache/spark/util/collection/unsafe/sort/UnsafeExternalSorter.java 1 addition, 9 deletions...ark/util/collection/unsafe/sort/UnsafeExternalSorter.java
- core/src/main/java/org/apache/spark/util/collection/unsafe/sort/UnsafeInMemorySorter.java 1 addition, 1 deletion...ark/util/collection/unsafe/sort/UnsafeInMemorySorter.java
- core/src/test/java/org/apache/spark/shuffle/sort/ShuffleInMemorySorterSuite.java 6 additions, 0 deletions...apache/spark/shuffle/sort/ShuffleInMemorySorterSuite.java
- core/src/test/java/org/apache/spark/util/collection/unsafe/sort/UnsafeInMemorySorterSuite.java 3 additions, 0 deletions...til/collection/unsafe/sort/UnsafeInMemorySorterSuite.java
Loading
Please register or sign in to comment