Uploaded image for project: 'Apache Arrow'
  1. Apache Arrow
  2. ARROW-12983

[C++][Python] Converter::Extend gets stuck in infinite loop causing OOM if values don't fit in single chunk

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 4.0.0, 4.0.1
    • 5.0.0
    • C++

    Description

      Apologies if this is a duplicate, I haven't found anything related

      When creating an arrow table via the python api, the following code runs out of memory after using all the available resources on a box with 512GB of ram. This happens with pyarrow 4.0.0 and 4.0.1. However when running the same code with pyarrow 3.0.0, the memory usage only reaches 5GB (which seems like the appropriate ballpark for the table size).
      The code generates a table with a single string column with 1m rows, each string being 3000 characters long.

      Not sure whether the issue is python related or not, I haven't tried replicating it from the C++ api.

       

      import os, string
      import numpy as np
      import pyarrow as pa
      
      print(pa.__version__)
      np.random.seed(42)
      
      alphabet = list(string.ascii_uppercase)
      
      _col = []
      for _n in range(1000):
        k = ''.join(np.random.choice(alphabet, 3000))
        _col += [k] * 1000
      
      table = pa.Table.from_pydict({'col': _col})
      

      Attachments

        Issue Links

          Activity

            People

              lidavidm David Li
              Laurent Mazare Laurent Mazare
              Votes:
              0 Vote for this issue
              Watchers:
              6 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 - 5h 20m
                  5h 20m