Uploaded image for project: 'Kylin'
  1. Kylin
  2. KYLIN-3899

Kylin throws OutOfMemory exception during the sql query

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • v2.5.2
    • v2.6.2, v3.0.0-alpha
    • Query Engine
    • None
    • Huawei FusionInsight

    Description

      Hi team:

      I use Tableau+Kylin in my OLAP system.
      But Kylin sometimes throws an OutOfMemory exception and then crashed.

      I find "OutOfMemoryError info" in kylin.log:

      java.lang.OutOfMemoryError: Java heap space

      Dumping heap to java_pid24217.hprof ...

      #

      #  java.lang.OutOfMemoryError: Java heap space

      #  -XX:OutOfMemoryError="kill -9 %p"

      #    Executing /bin/sh -c "kill -9 24217" ... 

      Java HotSpot(TM) 64-Bit Server VM warning:ignoring option MaxPermSize=512m; support was removed in 8.0

      Java HotSpot(TM) 64-Bit Server VM warning:Using incremental CMS is deprecated and will likely be removed in a future release.

      Then I use Memory Analyzer to analysis dump file. I find that all most of memory is occupied by a Tableau sql query thread, that query uses 23.4G memory, 99% of all mepory.

       

      I find that query thread has a big linkedlist uses  19.7G memory, this linkedlist has LogicalTupleFilter entity,  contains 43497028 entries.

       

      Then I find that the crash stack as these:

      at org.apache.kylin.metadata.filter.LogicalTupleFilter.copy()Lorg/apache/kylin/metadata/filter/TupleFilter; (LogicalTupleFilter.java 55)

      at org.apache.kylin.metadata.filter.TupleFilter.cartesianProduct(Ljava/util/List:Lorg/apache/kylin/metadata/filter/TupleFilter:)Ljava/util/List: (TupleFilter.java:279)

      at org.apache.kylin.metadata.filter.TupleFilter.flattenInternal(Lorg/apache/kylin/metadata/filter/TupleFilter:)Lorg/apache/kylin/metadata/filter/TupleFilter: (TupleFilter.java:252)

      at org.apache.kylin.metadata.filter.TupleFilter.flatFilter()Lorg/apache/kylin/metadata/filter/TupleFilter: (TupleFilter.java:218)

      at org.apache.kylin.cube.gridtable.ScanrangePlannerBase.flattenToOrAndFilter(Lorg/apache/kylin/metadata/filter/TupleFilter:)Lorg/apache/kylin/metadata/filter/TupleFilter: (ScanRangePlannerBase.java:73)

      at org.apache.kylin.storage.gtrecord.CubeScanRangePlanner.planScanRanges()Ljava/util/List; (CubeScanRangePlanner.java:216)

      ......

       

      I find that Kylin's SQL query statement which is generated by Tableau is very complex. The length of SQL query statement is 54836, with "IN", "NOT IN", multi-level "OR", "AND" conditions and group by filtering.

       

      Have other users ever had this problem?

       

      Best Regards.

      Thanks.

       

      Zhao Jintao.

       

       

       

       

       

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            zhao jintao zhao jintao
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 672h
                672h
                Remaining:
                Remaining Estimate - 672h
                672h
                Logged:
                Time Spent - Not Specified
                Not Specified