Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-391

Memory leak in fastbinary

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.1
    • Component/s: Python - Library
    • Labels:
      None
    • Environment:

      Linux 2.6.21 (Debian)

    • Patch Info:
      Patch Available

      Description

      When a struct has a map member, fastbinary.binary_encode leaks memory.

      Use testmem.tar.gz app to recreate the problem.

      # tar xzf testmem.tar.gz
      # cd testmem
      # ./testmem fast
      

      As this is running, use top or pidstat to view the memory consumed by the process. Hit CTRL-C to stop. On my system it steadily increases.

      To compare the results using the 'default' encoding technique (using pure Python TBinaryProtocol), run testmem as follows:

      # ./testmem default
      

      Note (again, using top, pidstat, etc.) that the memory used is constant.

      It appears that the 'map' member triggers this. E.g. string, int members do not cause the leak.

        Attachments

        1. thrift-fastbinary-leak.patch
          0.4 kB
          Alexander Shigin
        2. testmem.tar.gz
          2 kB
          Garrett Smith

          Activity

            People

            • Assignee:
              shigin Alexander Shigin
              Reporter:
              gar1t Garrett Smith
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: