Split Document into multiple document based on condition

I cannot imagine why that ruby filter would cause an OOM error. See this thread for how to deal with that.