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

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

    XMLWordPrintable

    Details

      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.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  luksa Marko Lukša
                  Reporter:
                  luksa Marko Lukša
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: