Fix memory consumption for streaming tasks by bounding the max queue size