Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-48544

Reduce memory pressure of empty TreeNode BitSets

    XMLWordPrintableJSON

Details

    Description

      By default, the TreeNode `treePatternBits` and `ineffectiveRules` variables are initialized to a `BitSet`, which takes up memory even when empty. For plans with a high number of TreeNodes, this adds unnecessary memory pressure, especially for large expression trees. Reduce the memory pressure by lazily initializing this variable.

      For `treePatternBits` we will observe no benefit because these are always populated. However, for `ineffectiveRules` it is not necessary to initialize this for every node. We should make this variable lazy, being careful to not initialize even when `get` is called.

      Related to SPARK-48047.

      Attachments

        Issue Links

          Activity

            People

              n-young-db Nick Young
              n-young-db Nick Young
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: