Uploaded image for project: 'MariaDB ColumnStore'
  1. MariaDB ColumnStore
  2. MCOL-1750

Thread stack memory leak in ThreadPool

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Critical
    • Resolution: Fixed
    • 1.1.5, 1.1.6
    • 1.1.7, 1.2.0
    • ExeMgr
    • None
    • 2018-18, 2018-19, 2018-20, 2018-21

    Description

      When ThreadPool self-prunes after a thread is idle for 10 minutes that thread is ended but not joined. This leaves a large amount of stack behind (8MB per thread in my machine). This turns into a large memory leak very quickly, especially hitting the limits of VIRT allocation.

      How to reproduce:

      1. Run the attach script (requires tpch1 lineitem table)
      2. Get the pid of ExeMgr (25001 in this example)
      3. Get the output of ulimit -s (8192 in this example)
      4. Run the following replacing the values above where appropriate:

      pmap 25001 | grep 8192 | wc -l
      

      5. Run the following replacing the values above where appropriate:

      ls /proc/25001/task | wc -l
      

      6. You should note the two numbers are very similar. Only 1 or two apart
      7. Wait > 10 minutes
      8. Do steps 4 and 5 again. You should notice the two numbers are now very different. This indicates a thread stack memory leak.

      Attachments

        1. test.sh
          0.2 kB
          Andrew Hutchings

        Issue Links

          Activity

            People

              dleeyh Daniel Lee (Inactive)
              LinuxJedi Andrew Hutchings (Inactive)
              Votes:
              2 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.