Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-19412

Potential memory leak in MailboxRegistryImpl under intensive SQL load

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.0.0-beta1
    • 3.0
    • sql

    Description

      I tried to run a SQL benchmark (slightly modified Benchbase TPC-C scenario) against Ignite3 (commit hash b48ddcba7cd2bd3b9a053ae131c25b44a0400e27).

      Ignite3 was running with -Xmx6G -Xms6G memory limit. After some time it has reached memory limits and failed due to OutOfMemoryError. A heap dump was generated on failure. I can't attach this dump due to its size, but I've opened it in MAT and created a report (see zip file attached).

      The report says that most of the retained heap (almost 5G) is occupied by a single instance of o.a.i.internal.sql.engine.exec.MailboxRegistryImpl class (see image attached).

      Hypothesis: on an intense load, MailboxRegistryImpl creates a lot of lambda expressions. This happens faster than they're being utilized. With limited memory size, it could lead to OOM at some moment.

      Benchmark is quite trivial by mechanics:

      1. Create a table structure (see DDL file attached)
      2. Fill tables with randomized data (several tens of thousands rows is enough)
      3. Run select queries in a loop (actually, it wouldn't happen; OOM was raised on data insertion).

      Attachments

        1. Screenshot_20230503_172458.png
          26 kB
          Andrey Khitrin
        2. java_pid4802_Leak_Suspects.zip
          114 kB
          Andrey Khitrin
        3. ddl-ignite3.sql
          5 kB
          Andrey Khitrin

        Issue Links

          Activity

            People

              korlov Konstantin Orlov
              akhitrin Andrey Khitrin
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m