GitHub user Xaprice opened a pull request:
https://github.com/apache/carbondata/pull/2136 [CARBONDATA-2307] Fix OOM issue when using DataFrame.coalesce Be sure to do all of the following checklist to help us incorporate your contribution quickly and easily: - [x] Any interfaces changed? NO - [x] Any backward compatibility impacted? NO - [x] Document update required? NO - [x] Testing done Please provide details on - Whether new unit test cases have been added or why no new tests are required? - How it is tested? Please attach test report. - Is it a performance related change? Please attach the performance test report. - Any additional information to help reviewers in testing this change. Tested on cluster - [x] For large changes, please consider breaking it into sub-tasks under an umbrella JIRA. Bug fix, not large changes You can merge this pull request into a Git repository by running: $ git pull https://github.com/Xaprice/carbondata fix_memoryleak_using_coalesce Alternatively you can review and apply these changes as the patch at: https://github.com/apache/carbondata/pull/2136.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #2136 ---- commit d4a233b86592ddca52b584a4dc22f3c84912483a Author: Jin Zhou <xaprice@...> Date: 2018-04-03T10:48:51Z [CARBONDATA-2307] Fix OOM issue when using DataFrame.coalesce ---- --- |
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/2136 Build Failed with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/4785/ --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/2136 Build Failed with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/3561/ --- |
In reply to this post by qiuchenjian-2
Github user ravipesala commented on the issue:
https://github.com/apache/carbondata/pull/2136 SDV Build Fail , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/4288/ --- |
In reply to this post by qiuchenjian-2
Github user chenliang613 commented on the issue:
https://github.com/apache/carbondata/pull/2136 retest this please --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/2136 Build Failed with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/3574/ --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/2136 Build Failed with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/4797/ --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/2136 Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/4799/ --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/2136 Build Success with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/3576/ --- |
In reply to this post by qiuchenjian-2
Github user Xaprice commented on the issue:
https://github.com/apache/carbondata/pull/2136 retest this please --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/2136 Build Failed with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/3581/ --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/2136 Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/4804/ --- |
In reply to this post by qiuchenjian-2
Github user manishgupta88 commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/2136#discussion_r179074140 --- Diff: integration/spark-common/src/main/scala/org/apache/carbondata/spark/rdd/CarbonScanRDD.scala --- @@ -402,7 +402,7 @@ class CarbonScanRDD( // one query id per table model.setQueryId(queryId) // get RecordReader by FileFormat - val reader: RecordReader[Void, Object] = inputSplit.getFileFormat match { + var reader: RecordReader[Void, Object] = inputSplit.getFileFormat match { --- End diff -- reader can be val...is there any specific purpose for making it var? --- |
In reply to this post by qiuchenjian-2
Github user manishgupta88 commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/2136#discussion_r179074922 --- Diff: integration/spark-common/src/main/scala/org/apache/carbondata/spark/rdd/CarbonScanRDD.scala --- @@ -438,7 +438,9 @@ class CarbonScanRDD( // for usage of unsafe method for processing of one blocklet and if there is any exception // while doing that the unsafe memory occupied for that task will not get cleared context.addTaskCompletionListener { _ => - reader.close() + if (reader != null) { + reader.close() + } --- End diff -- Remove null check and reader.close() call and call closeReader() method here --- |
In reply to this post by qiuchenjian-2
Github user manishgupta88 commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/2136#discussion_r179080266 --- Diff: core/src/main/java/org/apache/carbondata/core/datastore/chunk/impl/MeasureRawColumnChunk.java --- @@ -106,9 +106,13 @@ public ColumnPage convertToColumnPageWithOutCache(int index) { for (int i = 0; i < columnPages.length; i++) { if (columnPages[i] != null) { columnPages[i].freeMemory(); + columnPages[i] = null; } } } + if (rawData != null) { + rawData = null; + } --- End diff -- Same comment as above --- |
In reply to this post by qiuchenjian-2
Github user manishgupta88 commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/2136#discussion_r179080396 --- Diff: core/src/main/java/org/apache/carbondata/core/datastore/chunk/impl/DimensionRawColumnChunk.java --- @@ -106,9 +106,13 @@ public DimensionColumnPage convertToDimColDataChunkWithOutCache(int index) { for (int i = 0; i < dataChunks.length; i++) { if (dataChunks[i] != null) { dataChunks[i].freeMemory(); + dataChunks[i] = null; } } } + if (rawData != null) { + rawData = null; + } --- End diff -- No need for null check as rawData is being set only to null. Better to implement freeMemory method in super class AbstractRawColumnChunk and set rawData to null in that and call super.freeMemory() from child classes. --- |
In reply to this post by qiuchenjian-2
Github user Xaprice commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/2136#discussion_r179941484 --- Diff: integration/spark-common/src/main/scala/org/apache/carbondata/spark/rdd/CarbonScanRDD.scala --- @@ -402,7 +402,7 @@ class CarbonScanRDD( // one query id per table model.setQueryId(queryId) // get RecordReader by FileFormat - val reader: RecordReader[Void, Object] = inputSplit.getFileFormat match { + var reader: RecordReader[Void, Object] = inputSplit.getFileFormat match { --- End diff -- reader will be set null in closeReader() method to reduce memory occupation when using coalesce, otherwise there will be lots of reader instances in memory. --- |
In reply to this post by qiuchenjian-2
Github user Xaprice commented on the issue:
https://github.com/apache/carbondata/pull/2136 retest this please --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/2136 Build Success with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/3679/ --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/2136 Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/4902/ --- |
Free forum by Nabble | Edit this page |