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

[JAVA] enhance AllocationListener with an onFailedAllocation() call

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.10.0
    • Component/s: Java

      Description

      If an allocation fails, there might be an action taken by user code that will free up some memory before the allocation can be retried again. This action could include flushing some temporary buffers, getting rid of some temporarily cached data, or even spilling state to disk.

      Today's code is forced to catch out-of-memory exceptions, and then retry the operation at a high level. A more elegant way to do this is to have a callback whenever allocation failed. The callback would inform the allocator whether or not to retry the allocation.

      Since the allocator already has an AllocationListener, it makes sense to enhance the existing listener with a new method.

      The proposed signature is:

        boolean onAllocationFailed(long allocationSize);

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                vancobuca Vanco Buca
                Reporter:
                vancobuca Vanco Buca
              • Votes:
                0 Vote for this issue
                Watchers:
                2 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 - 2h
                  2h