[GitHub] carbondata pull request #2057: [CARBONDATA-2248]Fixed Memory leak in parser/...

2018-03-15 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/carbondata/pull/2057


---


[GitHub] carbondata pull request #2057: [CARBONDATA-2248]Fixed Memory leak in parser/...

2018-03-14 Thread kumarvishal09
Github user kumarvishal09 commented on a diff in the pull request:

https://github.com/apache/carbondata/pull/2057#discussion_r174682778
  
--- Diff: 
integration/spark2/src/main/scala/org/apache/spark/sql/parser/CarbonSparkSqlParser.scala
 ---
@@ -52,9 +52,12 @@ class CarbonSparkSqlParser(conf: SQLConf, sparkSession: 
SparkSession) extends Ab
   override def parsePlan(sqlText: String): LogicalPlan = {
 CarbonSession.updateSessionInfoToCurrentThread(sparkSession)
 try {
-  super.parsePlan(sqlText)
+  val parsedPlan = super.parsePlan(sqlText)
+  CarbonScalaUtil.cleanParserThreadLocals
--- End diff --

In case of exception it is calling CarbonSpark2SqlParser.parse which is 
already handling clearing thread local object so we cannot handle in finally 


---


[GitHub] carbondata pull request #2057: [CARBONDATA-2248]Fixed Memory leak in parser/...

2018-03-13 Thread jackylk
Github user jackylk commented on a diff in the pull request:

https://github.com/apache/carbondata/pull/2057#discussion_r174204132
  
--- Diff: 
integration/spark2/src/main/scala/org/apache/spark/sql/parser/CarbonSparkSqlParser.scala
 ---
@@ -52,9 +52,12 @@ class CarbonSparkSqlParser(conf: SQLConf, sparkSession: 
SparkSession) extends Ab
   override def parsePlan(sqlText: String): LogicalPlan = {
 CarbonSession.updateSessionInfoToCurrentThread(sparkSession)
 try {
-  super.parsePlan(sqlText)
+  val parsedPlan = super.parsePlan(sqlText)
+  CarbonScalaUtil.cleanParserThreadLocals
--- End diff --

Why not add it in finally block?


---


[GitHub] carbondata pull request #2057: [CARBONDATA-2248]Fixed Memory leak in parser/...

2018-03-12 Thread kumarvishal09
GitHub user kumarvishal09 opened a pull request:

https://github.com/apache/carbondata/pull/2057

[CARBONDATA-2248]Fixed Memory leak in parser/CarbonSparkSqlParser.scala

In some scenarios where more sessions are created, there are many parser 
failure objects are accumulated in memory inside thread locals and causing 
memory leak in long run.

Solution: Remove the parser object from thread local after parsing of the 
query

 - [ ] Any interfaces changed?
 
 - [ ] Any backward compatibility impacted?
 
 - [ ] Document update required?

 - [ ] 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.
   
 - [ ] For large changes, please consider breaking it into sub-tasks under 
an umbrella JIRA. 



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/kumarvishal09/incubator-carbondata 12-03-208

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/carbondata/pull/2057.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 #2057


commit d4df8ceeaa29a6281e731271c5f2f05861c73d9e
Author: kumarvishal 
Date:   2018-03-12T15:30:22Z

Fixed Memory leak in parser/CarbonSparkSqlParser.scala




---