A change was necessary, from recursive to iterative.
Problem with memory when using the recursive version of the trees evaluation function.