Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-2889

AbstractIterator shouldn't allocate a larger result array than is necessary

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Done
    • Major
    • 5.3.0.Alpha1
    • None
    • Embedded Querying
    • None

    Description

      Currently AbstractIterator (superclass of LazyIterator and EagerIterator) always allocates an Object[] array of size fetchSize, even when the actual number of results is smaller than fetchSize.

      This is especially problematic when the user wants to fetch all the results at once (by setting fetchSize to a very large number such as Integer.MAX_VALUE). This results in an OutOfMemoryError: Requested array size exceeds VM limit.

      Since the number of results is known up-front, AbstractIterator can allocate a smaller array.

      Attachments

        Activity

          People

            marko.luksa@gmail.com Marko Luksa (Inactive)
            marko.luksa@gmail.com Marko Luksa (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: