Fix issue #322

Use spooling for very large limit case.

The content byte size of the MinMaxPriorityQueue with a limit is not the accurate size but instead an estimate of the byte size of all elements contained in the Queue: (max_result_size_in_queue * queue_size), for the efficiency of byte size calculation.